Пример конфига sass для автоматической компиляции стилей.
Конфиг для scss файлов надо положить в директорию, где находятся компилируемые файлы.
# Подключаемые модули
require 'autoprefixer-rails'
require 'breakpoint'
# Основные настройки
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
# Для заливки на live
if environment == :production
output_style = :compressed
disable_warnings = true
line_comments = false
sass_options = {:quiet => true}
end
# Для разработки
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
require 'autoprefixer-rails'
require 'breakpoint'
# Основные настройки
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
# Для заливки на live
if environment == :production
output_style = :compressed
disable_warnings = true
line_comments = false
sass_options = {:quiet => true}
end
# Для разработки
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