Skip to content

Instantly share code, notes, and snippets.

@zeero
Last active August 29, 2015 13:55
Show Gist options
  • Save zeero/8775421 to your computer and use it in GitHub Desktop.
Save zeero/8775421 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'css_parser'
include CssParser
parser = CssParser::Parser.new
parser.load_file!('bootstrap-theme.css', 'bootstrap/dist/css/')
parser.load_file!('bootstrap.css', 'bootstrap/dist/css/')
arr = []
parser.each_selector() do |selector, declarations, specificity|
arr.push($1) if /\.([^\:\. \[]+)/ =~ selector
end
file = open('bootstrap.dict', 'w')
arr.uniq.sort.each do |item|
file.puts '"' + item + '"'
end
file.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment