Created
April 17, 2013 05:58
-
-
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()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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