Use sass-embedded
with SassC Ruby!
This library shims sassc
with the sass-embedded
implementation.
sass-embedded
is recommended for all projects. It is compatible with:
sassc-embedded
is recommended for existing projects still using sassc
or sprockets
. It is compatible with:
sassc
has reached end-of-life.sass
has reached end-of-life.Add this line to your application's Gemfile:
gem 'sassc-embedded'
And then execute:
bundle
Or install it yourself as:
gem install sassc-embedded
This shim utilizes sass-embedded
to allow you to compile SCSS or SASS syntax to CSS. To compile, use a SassC::Engine
, e.g.:
require 'sassc-embedded'
SassC::Engine.new(sass, style: :compressed).render
Most of the original sassc
options are supported with no behavior difference unless noted otherwise:
:filename
:quiet
:precision
:line_comments
:syntax
:source_map_embed
:source_map_contents
:omit_source_map_url
:source_map_file
:importer
:functions
:style
- :nested
:compact
:expanded
:load_paths
See sassc-ruby
source code and libsass
documentation for details.
Additional sass-embedded
options are supported:
:charset
:importers
:alert_ascii
:alert_color
:fatal_deprecations
:future_deprecations
:logger
:quiet_deps
:silence_deprecations
:verbose
See sass-embedded
documentation for details.
sassc
gem is still being used instead of sassc-embedded
When launching an application via bundle exec
, it puts sassc-embedded
at higher priority than sassc
in $LOAD_PATH
. You can verify the order of $LOAD_PATH
with the following command:
bundle exec ruby -e 'puts $LOAD_PATH'
If you see sassc
has higher priority than sassc-embedded
, try remove sassc
:
bundle remove sassc
If your application has a transitive dependency on sassc
that cannot be removed, you can use one of the following workarounds.
Add this line to your application's Gemfile:
gem 'sassc', github: 'sass/sassc-ruby', ref: 'refs/pull/233/head'
And then execute:
bundle
The fork of sassc
at https://github.com/sass/sassc-ruby/pull/233 will load the shim whenever require 'sassc'
is invoked, meaning no other code changes needed in your application.
Add this line to your application's code:
require 'sassc-embedded'