Set<string> All modifier names for quick lookup
Declarative modifier definitions for CSS-literal syntax.
Modifiers enable responsive, state-based, and contextual styling:
- Media modifiers: md:, print:, motion-safe:
- Ancestor modifiers: dark:, light:
- State modifiers: hover:, focus:, disabled:
- Pseudo-element modifiers: before:, after:
@see {@link https://github.com/fuzdev/fuz_css} for documentation
18 declarations
Set<string> All modifier names for quick lookup
Map<string, ModifierDefinition> Map of ancestor modifier names to their CSS output
RegExp Pattern for arbitrary max-width breakpoints: max-width(600px):
RegExp Pattern for arbitrary min-width breakpoints: min-width(800px):
(): string[] Gets all modifier names for error message suggestions.
string[] (segment: string): (ModifierDefinition & { is_arbitrary?: boolean | undefined; }) | null Gets the modifier definition for a segment. Handles both static modifiers and dynamic patterns (arbitrary breakpoints, parameterized states).
segmentstring(ModifierDefinition & { is_arbitrary?: boolean | undefined; }) | null The modifier definition or null if not a known modifier
Map<string, ModifierDefinition> Map of media modifier names to their CSS output
ModifierDefinition Definition for a single modifier.
nameThe prefix used in class names (e.g., 'hover', 'md', 'dark')
stringtypeType determines position in modifier order and CSS output behavior
cssThe CSS output - wrapper for media/ancestor, suffix for state/pseudo-element
stringorderOptional ordering within type (for breakpoints, sorted by this value)
numberModifierDefinition[] All modifier definitions in a single declarative structure. Adding a new modifier requires only adding to this array.
ModifierType Type of modifier determining its position in the class name and CSS output.
Order in class names: [media:][ancestor:][state...:][pseudo-element:]property:value
RegExp Pattern for parameterized nth-child: nth-child(2n+1):
RegExp Pattern for parameterized nth-last-child: nth-last-child(2n+1):
RegExp Pattern for parameterized nth-last-of-type: nth-last-of-type(2n):
RegExp Pattern for parameterized nth-of-type: nth-of-type(2n):
(segment: string): string | null Parses an arbitrary breakpoint modifier.
segmentstringstring | null The CSS media query or null if not an arbitrary breakpoint
(segment: string): { name: string; css: string; type: "state"; } | null Parses a parameterized state modifier (nth-child, nth-last-child, nth-of-type, nth-last-of-type).
segmentstring{ name: string; css: string; type: "state"; } | null Object with name (including parameter) and CSS, or null if not parameterized
Map<string, ModifierDefinition> Map of pseudo-element modifier names to their CSS output
Map<string, ModifierDefinition> Map of state modifier names to their CSS output