Method: Teacup::Stylesheet#style
- Defined in:
- lib/teacup/stylesheet.rb
#style(*queries) ⇒ Object
Add a set of properties for a given stylename or multiple stylenames.
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/teacup/stylesheet.rb', line 248 def style(*queries) if queries[-1].is_a? Hash properties = queries.pop else # empty style declarations are allowed, but accomplish nothing. return end queries.each do |stylename| # reset the stylesheet_cache for this stylename @stylesheet_cache.delete(stylename) if @stylesheet_cache # merge into styles[stylename] (an instance of Teacup::Style). new # properties "win" over existing properties. Teacup::merge_defaults(properties, styles[stylename], styles[stylename]) end end |