css_class_helpers.ts

Declarations
#

9 declarations

view source

collect_css_classes
#

css_class_helpers.ts view source

(contents: string, extractors?: CssExtractor[]): Set<string>

Returns a Set of CSS classes from a string of HTML/Svelte/JS/TS content. Handles class attributes, directives, and various forms of CSS class declarations.

contents

type string

extractors

type CssExtractor[]
default CSS_CLASS_EXTRACTORS

returns

Set<string>

CssClassDeclaration
#

CssClassDeclarationBase
#

CssClassDeclarationGroup
#

CssClassDeclarationInterpreter
#

CssClassDeclarationItem
#

CssClasses
#

css_class_helpers.ts view source

include_classes

type Set<string> | null

constructor

type new (include_classes?: Set<string> | null): CssClasses

include_classes
type Set<string> | null
default null

add

type (id: string, classes: Set<string>): void

id
type string
classes
type Set<string>
returns void

delete

type (id: string): void

id
type string
returns void

get

type (): Set<string>

returns Set<string>

CssExtractor
#

generate_classes_css
#

css_class_helpers.ts view source

(classes: Iterable<string>, classes_by_name: Record<string, CssClassDeclaration | undefined>, interpreters: CssClassDeclarationInterpreter[], log?: Logger | undefined): string

classes

type Iterable<string>

classes_by_name

type Record<string, CssClassDeclaration | undefined>

interpreters

type CssClassDeclarationInterpreter[]

log?

type Logger | undefined
optional

returns

string

Imported by
#