Use Dart Sass with Sprockets and the Ruby on Rails asset pipeline.
This gem is a fork of sass/sassc-rails which maintains API compatibility but delegates to the sass-embedded gem which uses Dart Sass instead of the libsass C implmentation.
For ease of upgrading, the root namespace ::SassC
is still used by this gem,
although it is now a misnomer. This is planned to be renamed in a future
major version release.
Add this line to your application's Gemfile:
gem 'dartsass-sprockets'
This will automatically configure your default Rails
config.assets.css_compressor
to use :sass
.
The current version of dartsass-sprockets
supports:
For older versions of Ruby and Rails may be supported with earlier versions of this gem.
This gem is a drop-in replacement to sass-rails. Note the following differences:
.css
files. Please ensure all your SASS files have file extension .scss
.config.sass.style
values :nested
and :compact
will behave as :expanded
. Use :compressed
for minification.config.sass.line_comments
option is ignored and will always be disabled.To turn on inline source maps, add the following configuration
to your development.rb
file:
# config/environments/development.rb
config.sass.inline_source_maps = true
After adding this config line, you may need to clear your assets cache
(rm -r tmp/cache/assets
), stop Spring, and restart your Rails server.
Note these source maps are inline and will be appended to the compiled
application.css
file. (They will not generate additional files.)
git checkout -b my-new-feature
)git commit -am 'Add some feature'
) - try to include testsgit push origin my-new-feature
)