Closed ahorek closed 4 years ago
my intention is to fix thread safety problems https://github.com/sass/sassc-ruby/issues/133 and https://github.com/rails/sprockets/issues/581 and eventually remove https://github.com/rails/sprockets/blob/0cb3314368f9f9e84343ebedcc09c7137e920bc4/lib/sprockets/utils.rb#L126
sassc doesn't allow you to use different functions for different contexts easily
you can customize functions by patching Sassc::Script::Functions, but there's a race condition if you do this at runtime
Sassc::Script::Functions
this patch will allow you to pass custom functions like this
module MyModule def asset_path(path, _options = {}) end end SassC::Engine.new(sass, style: :compressed).render # default Sassc::Script::Functions SassC::Engine.new(sass, style: :compressed, functions: MyModule).render # custom
what do you think?
Any chance for this to be released?
my intention is to fix thread safety problems https://github.com/sass/sassc-ruby/issues/133 and https://github.com/rails/sprockets/issues/581 and eventually remove https://github.com/rails/sprockets/blob/0cb3314368f9f9e84343ebedcc09c7137e920bc4/lib/sprockets/utils.rb#L126
sassc doesn't allow you to use different functions for different contexts easily
you can customize functions by patching
Sassc::Script::Functions
, but there's a race condition if you do this at runtimethis patch will allow you to pass custom functions like this
what do you think?