-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set sass options for silencing deprecations? #265
Comments
If you're using require 'sass-embedded'
Sass.compile('application.scss', quiet_deps: true).css
Sass.compile_string(sass, quiet_deps: true).css If you're using require 'sassc-embedded'
SassC::Engine.new(sass, quiet_deps: true).render If you're using config.assets.configure do |env|
sass_config = {
quiet_deps: true
}
env.register_transformer 'text/sass', 'text/css', Sprockets::SasscProcessor.new({ sass_config: })
env.register_transformer 'text/scss', 'text/css', Sprockets::ScsscProcessor.new({ sass_config: })
end In addition to |
@ntkme thank you. That worked. I had tried several attempts at a monkey patch but failed. Thank you again. Once we are ready to replace sassc-embedded with sass-embedded, can we still use sprockets-rails with sass-embedded as we did with sassc-embedded? Or it won't work and our we have to migrate to dartsass-rails? |
Current options for rails are:
I previously said in sass/sassc-ruby#220 that
|
Thank you, that breakdown is very helpful. Basically, the conclusion I came to on my own. The main concern is still having JS compiled and served through sprockets that cannot be easily migrated so looking for options to stick with sprockets for now. Otherwise, I'd just migrate to dartsass-rails and propshaft. Thank you again for the help and these libraries. |
I'm using sassc-embedded in a Rails app to update foundation-sites and foundation-emails to new versions that require Dart Sass which I'm very close to and will eventually swap to using sass-embedded directly. Thank you.
I don't believe I've ever had to set sass options before even when I used sass-rails v6 so the examples here suggest we should be compiling our sass directly but when using sprockets-rails it would be handled automatically. So it's confusing and unclear how I would change one of the options if I'm not directly calling the compile method.
With this gem, how do we set a sass option, for example
quiet_deps
to silence deprecation warnings, when using the sassc-embedded gem? And then again when using the sass-embedded gem directly? Both would be alongside sprockets-rails only. We are not using dartsass-sprockets and we have removed sassc-rails.The text was updated successfully, but these errors were encountered: