class
Components::CSS::ComponentCSSRegistry
- Components::CSS::ComponentCSSRegistry
- Reference
- Object
Overview
Global registry for component-level CSS.
Components register their CSS via the component_css macro.
The Generator collects all registered CSS for the @layer components block.
Defined in:
components/css/component_css_registry.crConstructors
Instance Method Summary
-
#all_css : String
Return all registered CSS concatenated, separated by newlines.
-
#clear
Clear registry (useful for testing)
-
#entries : Hash(String, String)
Each entry: {component_class_name => css_string}
-
#register(component_name : String, css : String)
Register CSS for a component class.
Constructor Detail
Instance Method Detail
def all_css : String
#
Return all registered CSS concatenated, separated by newlines. Component CSS is emitted in registration order.
def register(component_name : String, css : String)
#
Register CSS for a component class. If the same class name registers twice, the later registration wins (last-writer-wins). This allows subclass overrides.