From: Andy Allan Date: Wed, 12 Jul 2023 16:46:01 +0000 (+0100) Subject: Avoid using sprockets for combining stylesheets X-Git-Tag: live~1208^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/e108ec6d48e4e2ec5f7c6451fde7328adcb1c7cd 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 --- 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";