Skip to content

Instantly share code, notes, and snippets.

@danwaz
Created August 5, 2013 17:40
Show Gist options
  • Save danwaz/6157838 to your computer and use it in GitHub Desktop.
Save danwaz/6157838 to your computer and use it in GitHub Desktop.
Compass config.rb setup for Wordpress
# Require any additional compass plugins here.
require "susy"
require 'fileutils'
require 'sass-globbing'
# Set this to the root of your project when deployed:
http_path = "/wp-content/themes/YOUR_THEME/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
# You can select your preferred output style here (can be overridden via the command line):
output_style = :compressed
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
# line_comments = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
#Move CSS into the theme route after compilation
on_stylesheet_saved do |file|
if File.exists?(file) && File.basename(file) == "style.css"
puts "Moving: #{file}"
FileUtils.mv(file, File.dirname(file) + "/../" + File.basename(file))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment