lib/glimmer/css/rule.rb in glimmer-dsl-css-1.2.3 vs lib/glimmer/css/rule.rb in glimmer-dsl-css-1.4.1
- old
+ new
@@ -22,12 +22,14 @@
module Glimmer
module CSS
class Rule
attr_reader :selector, :properties
- def initialize(selector)
+ def initialize(selector, parent:)
@selector = selector
@properties = {}
+ @parent = parent
+ parent.rules << self
end
def add_property(keyword, *args)
keyword = keyword.to_s.downcase.gsub('_', '-')
@properties[keyword] = args.first