Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

dumps sass variables

View controller.rb
1 2 3 4 5 6 7 8 9 10 11 12 13
# ref: http://bit.ly/fN2ep8
# http://twitpic.com/3rr8dk
def sass_colors
engine= Sass::Engine.new(File.read("app/stylesheets/_colors.scss"), :syntax => :scss, :load_paths => ["app/stylesheets"])
environment= Sass::Environment.new
engine.to_tree.children.each do | node |
next unless node.kind_of? Sass::Tree::VariableNode
node.perform environment
end
 
@sass_vars= environment.instance_variable_get("@vars").reject{|k| k == "important" }
end
View controller.rb
1 2 3 4 5 6 7 8 9 10 11
%h2 SASS Colors
 
%table
%tr
%th Variable
%th Color
 
- @sass_vars.each do |var|
%tr
%td= "#{var[0]}: #{var[1]}"
%td{:style => "background-color:#{var[1]};width:80%;height:32px;"}  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.