From 3e28b9adf1230aa83c5ed39b1b05e8d1f90d3df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Maniaci?= Date: Tue, 13 Aug 2019 14:55:45 +0100 Subject: [PATCH] gem: move to libsassc The `sass` ruby gem is deprecated and `libsassc` (gem name: `sassc`) is a much-faster, drop-in replacement. Unfortunately `middleman-sprockets` isn't always happy with the new gem[1] so include the old one as well in the bundle. As per the code changes, point towards a standard and IE-specific manifests, which in turn include the GOV.UK Frontend assets with the correct ie-specific variables set in the latter case. (re)compile-time greatly reduced. [1]: https://github.com/middleman/middleman-sprockets/issues/132 --- Gemfile | 2 ++ Gemfile.lock | 4 +++- source/layouts/layout.erb | 4 ++-- source/stylesheets/manifest-old-ie.css | 5 +++++ source/stylesheets/manifest.css | 2 ++ source/stylesheets/manifest.css.scss | 1 - source/stylesheets/screen-old-ie.css.scss | 4 ---- 7 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 source/stylesheets/manifest-old-ie.css create mode 100644 source/stylesheets/manifest.css delete mode 100644 source/stylesheets/manifest.css.scss delete mode 100644 source/stylesheets/screen-old-ie.css.scss diff --git a/Gemfile b/Gemfile index d70233a5..b42966f6 100644 --- a/Gemfile +++ b/Gemfile @@ -12,4 +12,6 @@ gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby] gem 'middleman', '>= 4.0.0' gem 'middleman-livereload' gem "middleman-sprockets" +gem 'sprockets', '4.0.0beta10' gem 'sass' +gem 'sassc' diff --git a/Gemfile.lock b/Gemfile.lock index 2325e616..260bfc70 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -102,7 +102,7 @@ GEM ffi (~> 1.9) rake servolux (0.13.0) - sprockets (3.7.2) + sprockets (4.0.0.beta10) concurrent-ruby (~> 1.0) rack (> 1, < 3) temple (0.8.1) @@ -122,6 +122,8 @@ DEPENDENCIES middleman-livereload middleman-sprockets sass + sassc + sprockets (= 4.0.0beta10) tzinfo-data wdm (~> 0.1.0) diff --git a/source/layouts/layout.erb b/source/layouts/layout.erb index f6860c5d..93185782 100644 --- a/source/layouts/layout.erb +++ b/source/layouts/layout.erb @@ -12,8 +12,8 @@ - <%= stylesheet_link_tag :screen, media: 'screen' %> - + <%= stylesheet_link_tag :manifest, media: 'screen' %> + <%= stylesheet_link_tag :print, media: 'print' %> <%= javascript_include_tag :application %> diff --git a/source/stylesheets/manifest-old-ie.css b/source/stylesheets/manifest-old-ie.css new file mode 100644 index 00000000..7f942411 --- /dev/null +++ b/source/stylesheets/manifest-old-ie.css @@ -0,0 +1,5 @@ +$is-ie: true; +$ie-version: 8; + +//= require screen +//= link_tree "../../node_modules/govuk-frontend/govuk/assets" diff --git a/source/stylesheets/manifest.css b/source/stylesheets/manifest.css new file mode 100644 index 00000000..1ac73abc --- /dev/null +++ b/source/stylesheets/manifest.css @@ -0,0 +1,2 @@ +//= require screen +//= link_tree "../../node_modules/govuk-frontend/govuk/assets" diff --git a/source/stylesheets/manifest.css.scss b/source/stylesheets/manifest.css.scss deleted file mode 100644 index f81fc612..00000000 --- a/source/stylesheets/manifest.css.scss +++ /dev/null @@ -1 +0,0 @@ -//= link_tree ../../node_modules/govuk-frontend/govuk/assets diff --git a/source/stylesheets/screen-old-ie.css.scss b/source/stylesheets/screen-old-ie.css.scss deleted file mode 100644 index 63de02be..00000000 --- a/source/stylesheets/screen-old-ie.css.scss +++ /dev/null @@ -1,4 +0,0 @@ -$is-ie: true; -$ie-version: 8; - -@import "core";