Skip to content

Instantly share code, notes, and snippets.

@thetrickster
Created January 31, 2014 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thetrickster/8725365 to your computer and use it in GitHub Desktop.
Save thetrickster/8725365 to your computer and use it in GitHub Desktop.
Compass Wordpress Theme SCSS Helper -- This updated config.rb file has a ruby method that compiles /scss/styles.scss and copies the style.css file out of /scss/ and into the project root. Works best for a WP theme development workflow.
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "scss"
images_dir = "images"
javascripts_dir = "javascripts"
# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :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
require 'fileutils'
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