File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
- require 'sprockets/sass_functions'
3
+ begin
4
+ require 'sprockets/sassc_processor'
5
+ mod = Sprockets ::SasscProcessor ::Functions
6
+ rescue LoadError
7
+ require 'sprockets/sass_functions'
8
+ mod = Sprockets ::SassFunctions
9
+ end
4
10
5
- module Sprockets
6
- module SassFunctions
7
- def asset_data_url ( path )
8
- ::SassC ::Script ::Value ::String . new ( "url(" + sprockets_context . asset_data_uri ( path . value ) + ")" )
9
- end
11
+ mod . instance_eval do
12
+ def asset_data_url ( path )
13
+ ::SassC ::Script ::Value ::String . new ( "url(" + sprockets_context . asset_data_uri ( path . value ) + ")" )
10
14
end
11
15
end
12
16
13
- ::SassC ::Script ::Functions . send :include , Sprockets :: SassFunctions
17
+ ::SassC ::Script ::Functions . send :include , mod
You can’t perform that action at this time.
0 commit comments