Skip to content

Commit

Permalink
gem: move to libsassc
Browse files Browse the repository at this point in the history
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]: middleman/middleman-sprockets#132
  • Loading branch information
freesteph committed Aug 13, 2019
1 parent 4bb6968 commit 3e28b9a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -122,6 +122,8 @@ DEPENDENCIES
middleman-livereload
middleman-sprockets
sass
sassc
sprockets (= 4.0.0beta10)
tzinfo-data
wdm (~> 0.1.0)

Expand Down
4 changes: 2 additions & 2 deletions source/layouts/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<%= current_page.data.description %>">

<!--[if gt IE 8]><!--><%= stylesheet_link_tag :screen, media: 'screen' %><!--<![endif]-->
<!--[if lte IE 8]><%= stylesheet_link_tag 'screen-old-ie', media: 'screen' %><![endif]-->
<!--[if gt IE 8]><!--><%= stylesheet_link_tag :manifest, media: 'screen' %><!--<![endif]-->
<!--[if lte IE 8]><%= stylesheet_link_tag 'manifest-old-ie', media: 'screen' %><![endif]-->
<%= stylesheet_link_tag :print, media: 'print' %>

<%= javascript_include_tag :application %>
Expand Down
5 changes: 5 additions & 0 deletions source/stylesheets/manifest-old-ie.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$is-ie: true;
$ie-version: 8;

//= require screen
//= link_tree "../../node_modules/govuk-frontend/govuk/assets"
2 changes: 2 additions & 0 deletions source/stylesheets/manifest.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//= require screen
//= link_tree "../../node_modules/govuk-frontend/govuk/assets"
1 change: 0 additions & 1 deletion source/stylesheets/manifest.css.scss

This file was deleted.

4 changes: 0 additions & 4 deletions source/stylesheets/screen-old-ie.css.scss

This file was deleted.

0 comments on commit 3e28b9a

Please sign in to comment.