Skip to content

Instantly share code, notes, and snippets.

@darren131
Created April 17, 2013 05:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darren131/5402087 to your computer and use it in GitHub Desktop.
Save darren131/5402087 to your computer and use it in GitHub Desktop.
Compass and Wordpress Automating folder name and theme name Note in style.scss comment section we call wp_theme_name()
# get the name of your theme folder
WP_THEME_FOLDER = File.basename(File.dirname(__FILE__))
# best path for assets in Wordpress project
http_path = "/wp-content/themes/#{WP_THEME_FOLDER}/"
css_dir = "."
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
fonts_dir = "fonts"
output_style = :expanded
environment = :development
# get Sass sourcemaps working
sass_options = { :debug_info => true }
module Sass::Script::Functions
# new function to putput the theme folder for use in style.scss
def wp_theme_name()
Sass::Script::String.new(WP_THEME_FOLDER)
end
end
@import "compass";
/*!
Theme Name: #{wp_theme_name()}
Theme URI: http://thefold.co.nz/
Author: The Fold
Author URI: http://thefold.co.nz/
Description: The default site theme built by The Fold.
Version: 1.0
*/
// your styles here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment