From e108ec6d48e4e2ec5f7c6451fde7328adcb1c7cd Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 12 Jul 2023 17:46:01 +0100 Subject: [PATCH] Avoid using sprockets for combining stylesheets There are two options for combining stylesheets, using sprockets (via `require` statements) or using sass (via `@import` statements). This commit switches to using `@import` statements throughout, to avoid a bug with libsass that prevents us from using bootstrap 5.2+ See https://github.com/sass/sassc-rails/issues/174 Since R2 is not triggered when `@import`ing a file, we need to switch the top-level stylesheet names to include the extension. We can also take the opportunity to remove a level of indirection, along with removing symlinks which cause problems on some platforms. * https://github.com/openstreetmap/openstreetmap-website/issues/3984 * https://github.com/openstreetmap/openstreetmap-website/issues/3422 --- app/assets/stylesheets/ltr/common.scss | 1 - app/assets/stylesheets/print-ltr.css | 3 --- app/assets/stylesheets/print-ltr.scss | 1 + app/assets/stylesheets/print-rtl.css | 3 --- app/assets/stylesheets/print-rtl.r2.scss | 1 + app/assets/stylesheets/{print.css => print.scss} | 0 app/assets/stylesheets/rtl/common.r2.scss | 1 - app/assets/stylesheets/screen-ltr.css | 3 --- app/assets/stylesheets/screen-ltr.scss | 1 + app/assets/stylesheets/screen-rtl.css | 3 --- app/assets/stylesheets/screen-rtl.r2.scss | 1 + 11 files changed, 4 insertions(+), 14 deletions(-) delete mode 120000 app/assets/stylesheets/ltr/common.scss delete mode 100644 app/assets/stylesheets/print-ltr.css create mode 100644 app/assets/stylesheets/print-ltr.scss delete mode 100644 app/assets/stylesheets/print-rtl.css create mode 100644 app/assets/stylesheets/print-rtl.r2.scss rename app/assets/stylesheets/{print.css => print.scss} (100%) delete mode 120000 app/assets/stylesheets/rtl/common.r2.scss delete mode 100644 app/assets/stylesheets/screen-ltr.css create mode 100644 app/assets/stylesheets/screen-ltr.scss delete mode 100644 app/assets/stylesheets/screen-rtl.css create mode 100644 app/assets/stylesheets/screen-rtl.r2.scss diff --git a/app/assets/stylesheets/ltr/common.scss b/app/assets/stylesheets/ltr/common.scss deleted file mode 120000 index 85037a3c7..000000000 --- a/app/assets/stylesheets/ltr/common.scss +++ /dev/null @@ -1 +0,0 @@ -../common.scss \ No newline at end of file diff --git a/app/assets/stylesheets/print-ltr.css b/app/assets/stylesheets/print-ltr.css deleted file mode 100644 index 162c6f23c..000000000 --- a/app/assets/stylesheets/print-ltr.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= require print - */ diff --git a/app/assets/stylesheets/print-ltr.scss b/app/assets/stylesheets/print-ltr.scss new file mode 100644 index 000000000..ced65cf98 --- /dev/null +++ b/app/assets/stylesheets/print-ltr.scss @@ -0,0 +1 @@ +@import "print"; diff --git a/app/assets/stylesheets/print-rtl.css b/app/assets/stylesheets/print-rtl.css deleted file mode 100644 index 162c6f23c..000000000 --- a/app/assets/stylesheets/print-rtl.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= require print - */ diff --git a/app/assets/stylesheets/print-rtl.r2.scss b/app/assets/stylesheets/print-rtl.r2.scss new file mode 100644 index 000000000..ced65cf98 --- /dev/null +++ b/app/assets/stylesheets/print-rtl.r2.scss @@ -0,0 +1 @@ +@import "print"; diff --git a/app/assets/stylesheets/print.css b/app/assets/stylesheets/print.scss similarity index 100% rename from app/assets/stylesheets/print.css rename to app/assets/stylesheets/print.scss diff --git a/app/assets/stylesheets/rtl/common.r2.scss b/app/assets/stylesheets/rtl/common.r2.scss deleted file mode 120000 index 85037a3c7..000000000 --- a/app/assets/stylesheets/rtl/common.r2.scss +++ /dev/null @@ -1 +0,0 @@ -../common.scss \ No newline at end of file diff --git a/app/assets/stylesheets/screen-ltr.css b/app/assets/stylesheets/screen-ltr.css deleted file mode 100644 index a0890d1e0..000000000 --- a/app/assets/stylesheets/screen-ltr.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= require ltr/common - */ diff --git a/app/assets/stylesheets/screen-ltr.scss b/app/assets/stylesheets/screen-ltr.scss new file mode 100644 index 000000000..c525060af --- /dev/null +++ b/app/assets/stylesheets/screen-ltr.scss @@ -0,0 +1 @@ +@import "common"; diff --git a/app/assets/stylesheets/screen-rtl.css b/app/assets/stylesheets/screen-rtl.css deleted file mode 100644 index c0f4d793a..000000000 --- a/app/assets/stylesheets/screen-rtl.css +++ /dev/null @@ -1,3 +0,0 @@ -/* - *= require rtl/common - */ diff --git a/app/assets/stylesheets/screen-rtl.r2.scss b/app/assets/stylesheets/screen-rtl.r2.scss new file mode 100644 index 000000000..c525060af --- /dev/null +++ b/app/assets/stylesheets/screen-rtl.r2.scss @@ -0,0 +1 @@ +@import "common"; -- 2.39.5