class Components::CSS::ComponentCSSRegistry

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.instance : ComponentCSSRegistry #

[View source]
def self.new #

[View source]

Instance Method Detail

def all_css : String #

Return all registered CSS concatenated, separated by newlines. Component CSS is emitted in registration order.


[View source]
def clear #

Clear registry (useful for testing)


[View source]
def entries : Hash(String, String) #

Each entry: {component_class_name => css_string}


[View source]
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.


[View source]