]> git.openstreetmap.org Git - rails.git/blob - config/initializers/rtlcss.rb
Merge remote-tracking branch 'upstream/pull/5401'
[rails.git] / config / initializers / rtlcss.rb
1 require "rtlcss"
2
3 class RtlcssSCSSProcessor < SassC::Rails::ScssTemplate
4   def self.call(input)
5     output = super
6     data = Rtlcss.flip_css(output[:data])
7     output.delete(:map)
8     output.merge(:data => data)
9   end
10 end
11
12 Rails.application.config.assets.configure do |env|
13   env.register_mime_type "text/rtlcss+scss", :extensions => [".rtlcss.scss"]
14   env.register_transformer "text/rtlcss+scss", "text/css", RtlcssSCSSProcessor
15   env.register_preprocessor "text/rtlcss+scss", Sprockets::DirectiveProcessor.new(:comments => ["//", ["/*", "*/"]])
16 end