class
Components::CSS::Engine::Rule
- Components::CSS::Engine::Rule
- Reference
- Object
Overview
Represents a single CSS rule
Defined in:
components/css/engine/css_rule.crConstructors
Instance Method Summary
-
#add_declaration(property : String, value : String)
Add a declaration
- #attribute_selector : String | Nil
- #container_query : String | Nil
- #declarations : Hash(String, String)
-
#full_selector : String
Get the full selector (with pseudo class and attribute selector)
-
#matches_class?(class_name : String) : Bool
Check if this rule matches a class name
- #media_query : String | Nil
- #priority : Int32
- #pseudo_class : String | Nil
-
#render : String
Render to CSS
- #selector : String
-
#set_attribute_selector(selector : String) : self
Set attribute selector directly
-
#with_attribute(attr : String, value : String) : self
Set attribute selector with value (e.g., [aria-expanded="true"])
-
#with_attribute_present(attr : String) : self
Set attribute presence selector (e.g., [data-disabled])
-
#with_complex_pseudo(selector : String) : self
Set a complex pseudo selector (e.g., ":is([inert], [inert] *)")
-
#with_container(query : String) : self
Set container query
-
#with_media(query : String) : self
Set media query
-
#with_pseudo(pseudo : String) : self
Set pseudo class
Constructor Detail
Instance Method Detail
def with_attribute(attr : String, value : String) : self
#
Set attribute selector with value (e.g., [aria-expanded="true"])
def with_attribute_present(attr : String) : self
#
Set attribute presence selector (e.g., [data-disabled])
def with_complex_pseudo(selector : String) : self
#
Set a complex pseudo selector (e.g., ":is([inert], [inert] *)")