CSSPool 是一个 Ruby 用于解析 CSS 的工具包,示例代码:
`require ‘csspool’ sac = CSS::SAC::Parser.new doc = sac.parse(DATA.read) doc.rules.each do |rule| puts rule.selector.to_css rule.properties.each do |property| p property end end END
h1 { background: red; }`