Class: Cataract::Declaration
- Inherits:
-
Struct
- Object
- Struct
- Cataract::Declaration
- Defined in:
- lib/cataract/declaration.rb,
lib/cataract/declaration.rb
Overview
Represents a CSS property declaration.
Declaration is a Struct with fields: (property, value, important)
Instance Attribute Summary collapse
-
#important ⇒ Boolean
Whether the declaration has !important.
-
#property ⇒ String
CSS property name (lowercased).
-
#value ⇒ String
CSS property value.
Instance Method Summary collapse
-
#custom_property? ⇒ Boolean
Check if this declaration is a custom property (CSS variable).
Instance Attribute Details
#important ⇒ Boolean
Whether the declaration has !important
17 18 19 |
# File 'lib/cataract/declaration.rb', line 17 def important @important end |
#property ⇒ String
CSS property name (lowercased)
17 18 19 |
# File 'lib/cataract/declaration.rb', line 17 def property @property end |
#value ⇒ String
CSS property value
17 18 19 |
# File 'lib/cataract/declaration.rb', line 17 def value @value end |
Instance Method Details
#custom_property? ⇒ Boolean
Check if this declaration is a custom property (CSS variable).
Custom properties are properties that start with the "--" prefix.
33 34 35 |
# File 'lib/cataract/declaration.rb', line 33 def custom_property? property.start_with?('--') end |