class_variable_index.ts

Class-to-variable index for bundled CSS generation.

Builds an index mapping CSS class names to the CSS variables they use. This enables the bundled generator to include theme variables needed by the utility classes actually used in the project.

Declarations
#

5 declarations

view source

build_class_variable_index
#

class_variable_index.ts view source

(definitions: Record<string, CssClassDefinition | undefined>): CssClassVariableIndex

Builds an index of CSS variables used by each class definition.

definitions

CSS class definitions to index

type Record<string, CssClassDefinition | undefined>

returns

CssClassVariableIndex

CssClassVariableIndex with variable lookups

collect_class_variables
#

class_variable_index.ts view source

(index: CssClassVariableIndex, class_names: Iterable<string>): Set<string>

Collects all variables used by a set of classes.

index

the class variable index

class_names

class names to collect variables from

type Iterable<string>

returns

Set<string>

set of all variable names used by the classes

CssClassVariableIndex
#

class_variable_index.ts view source

CssClassVariableIndex

Index mapping class names to their CSS variable dependencies.

by_class

Map from class name to set of variable names (without -- prefix)

type Map<string, Set<string>>

get_class_variables
#

class_variable_index.ts view source

(index: CssClassVariableIndex, class_name: string): Set<string> | null

Gets variables used by a specific class.

index

the class variable index

class_name

name of the class to lookup

type string

returns

Set<string> | null

set of variable names (without -- prefix), or null if class not found

get_classes_using_variable
#

class_variable_index.ts view source

(index: CssClassVariableIndex, variable_name: string): string[]

Gets all class names that use a specific variable.

index

the class variable index

variable_name

variable name to search for (without -- prefix)

type string

returns

string[]

array of class names that use this variable

Depends on
#

Imported by
#