config sass (scss)

Example sass config for automatic style compilation.

The config for scss files must be put in the directory where the compiled files are located.

# Plugins
require ‘autoprefixer-rails’
require ‘breakpoint’

# Basic settings
http_path = “..”
css_dir = “css”
sass_dir = “scss”
images_dir = “img”
javascripts_dir = “js”
environment =: development
encoding = “utf-8”
cache = true
cache_path = “.scss-cache”
sourcemap = false

# For uploading to live
if environment ==: production
output_style =: compressed
disable_warnings = true
line_comments = false
sass_options = {: quiet => true}
end

# For development
if environment! =: production
output_style =: expanded
disable_warnings = true
line_comments = true
sass_options = {: quiet => true}
end

on_stylesheet_saved do | file |
css = File.read (file)
File.open (file, ‘w’) do | io |
io << AutoprefixerRails.process(css, { browsers: ['last 3 versions', 'iOS >= 9 ‘]})
end
end

Hello! You are on my site. I am a developer. Here I share my best practices and knowledge. Ask in the comments if you don’t understand something or write if you have something to add.

Similar Posts

Leave a Reply