internal
The lookup behind `get_all_modifier_names`.
Set<string> type Set<string>
import {ALL_MODIFIER_NAMES} from '@fuzdev/fuz_css/modifiers.js'; All modifier names for quick lookup.
Declarative modifier definitions for CSS-literal syntax.
Modifiers enable responsive, state-based, and contextual styling:
md:, print:, motion-safe:dark:, light:hover:, focus:, disabled:before:, after:@see {@link https://github.com/fuzdev/fuz_css} for documentation
17 declarations
internal
The lookup behind `get_all_modifier_names`.
Set<string> type Set<string>
import {ALL_MODIFIER_NAMES} from '@fuzdev/fuz_css/modifiers.js'; All modifier names for quick lookup.
Map<string, ModifierDefinition> type Map<string, ModifierDefinition>
import {ANCESTOR_MODIFIERS} from '@fuzdev/fuz_css/modifiers.js'; Map of ancestor modifier names to their CSS output
(segment: string, prefix: string): string | null import {extract_balanced_parens} from '@fuzdev/fuz_css/modifiers.js'; Extracts content from balanced parentheses after a prefix. Supports nested parens for calc(), clamp(), min(), max(), etc.
segmentthe full segment to parse (e.g., "min-width(calc(100vw - 200px))")
stringprefixthe prefix before the opening paren (e.g., "min-width")
stringstring | null
the content inside the balanced parens, or null if no match/unbalanced
extract_balanced_parens("min-width(800px)", "min-width") // "800px"
extract_balanced_parens("min-width(calc(100vw - 20px))", "min-width") // "calc(100vw - 20px)"
extract_balanced_parens("min-width(calc(100vw)", "min-width") // null (unbalanced)(): string[] import {get_all_modifier_names} from '@fuzdev/fuz_css/modifiers.js'; Gets all modifier names for error message suggestions.
string[] (segment: string): (ModifierDefinition & { is_arbitrary?: boolean | undefined; }) | null import {get_modifier} from '@fuzdev/fuz_css/modifiers.js'; 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> type Map<string, ModifierDefinition>
import {MEDIA_MODIFIERS} from '@fuzdev/fuz_css/modifiers.js'; Map of media modifier names to their CSS output
ModifierDefinition import type {ModifierDefinition} from '@fuzdev/fuz_css/modifiers.js'; Definition for a single modifier.
nameThe prefix used in class names (e.g., 'hover', 'md', 'dark')
type string
typeType determines position in modifier order and CSS output behavior
type ModifierType
cssThe CSS output - wrapper for media/ancestor, suffix for state/pseudo-element
type string
order?Optional ordering within type (for breakpoints, sorted by this value)
type number
ModifierDefinition[] type ModifierDefinition[]
import {MODIFIERS} from '@fuzdev/fuz_css/modifiers.js'; All modifier definitions in a single declarative structure. Adding a new modifier requires only adding to this array.
ModifierType type "media" | "ancestor" | "state" | "pseudo-element"
import type {ModifierType} from '@fuzdev/fuz_css/modifiers.js'; Type of modifier determining its position in the class name and CSS output.
Order in class names: [media:][ancestor:][state...:][pseudo-element:]property:value
internal
Read by `get_modifier`; exported for its tests.
RegExp import {NTH_CHILD_PATTERN} from '@fuzdev/fuz_css/modifiers.js'; Pattern for parameterized nth-child: nth-child(2n+1):
internal
Read by `get_modifier`; exported for its tests.
RegExp import {NTH_LAST_CHILD_PATTERN} from '@fuzdev/fuz_css/modifiers.js'; Pattern for parameterized nth-last-child: nth-last-child(2n+1):
internal
Read by `get_modifier`; exported for its tests.
RegExp import {NTH_LAST_OF_TYPE_PATTERN} from '@fuzdev/fuz_css/modifiers.js'; Pattern for parameterized nth-last-of-type: nth-last-of-type(2n):
internal
Read by `get_modifier`; exported for its tests.
RegExp import {NTH_OF_TYPE_PATTERN} from '@fuzdev/fuz_css/modifiers.js'; Pattern for parameterized nth-of-type: nth-of-type(2n):
(segment: string): string | null import {parse_arbitrary_breakpoint} from '@fuzdev/fuz_css/modifiers.js'; Parses an arbitrary breakpoint modifier. Supports nested parentheses for calc(), clamp(), min(), max(), var(). Requires value to start with a digit or known CSS function to catch obvious mistakes.
segmentstringstring | null
the CSS media query or null if not an arbitrary breakpoint
parse_arbitrary_breakpoint("min-width(800px)") // "@media (width >= 800px)"
parse_arbitrary_breakpoint("min-width(calc(100vw - 200px))") // "@media (width >= calc(100vw - 200px))"
parse_arbitrary_breakpoint("min-width(px)") // null (invalid - no digit or function)(segment: string): { name: string; css: string; type: "state"; } | null import {parse_parameterized_state} from '@fuzdev/fuz_css/modifiers.js'; 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> type Map<string, ModifierDefinition>
import {PSEUDO_ELEMENT_MODIFIERS} from '@fuzdev/fuz_css/modifiers.js'; Map of pseudo-element modifier names to their CSS output
Map<string, ModifierDefinition> type Map<string, ModifierDefinition>
import {STATE_MODIFIERS} from '@fuzdev/fuz_css/modifiers.js'; Map of state modifier names to their CSS output