Last active
December 21, 2015 05:39
-
-
Save justvitalius/6259045 to your computer and use it in GitHub Desktop.
SCSS code like this:
foo{ __bar{}
} in results CSS will be like this:
foo_bar{}
=|= Create filename.rb in config/initializers folder with gist contents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sprockets/railtie' | |
Rails.application.assets.register_postprocessor 'text/css', :sass_bem_class_builder do |context, data| | |
data.gsub(/([a-zA-Z0-9\-]+)[ ]([_]+)/i){ $1 + $2 } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment