Class: StringSets

StringSets(chunker, polisher, caller)

Handles CSS string-set properties to create and manage CSS custom properties for first, last, start, and first-except string values on paged content.

Parses the string-set CSS declaration, transforms string() function content, and updates CSS variables on each page after layout.

Constructor

new StringSets(chunker, polisher, caller)

Creates an instance of StringSets.

Creates an instance of StringSets.

Parameters:
Name Type Description
chunker Object

Chunker instance to manage content chunking.

polisher Object

Polisher instance for post-processing.

caller Object

Calling controller instance.

Source:

Extends

  • Handler

Members

pageLastString :Object.<string, string>|undefined

Keeps track of the last string value per identifier on the previous page.

Keeps track of the last string value per identifier on the previous page.

Type:
  • Object.<string, string> | undefined
Source:

stringSetSelectors :Object.<string, {identifier: string, func: string, value: string, selector: string}>

Stores selectors and related string-set info keyed by identifier.

Stores selectors and related string-set info keyed by identifier.

Type:
  • Object.<string, {identifier: string, func: string, value: string, selector: string}>
Source:

type :string|undefined

Holds the type of string currently processed (e.g.

Holds the type of string currently processed (e.g. "first", "last").

Type:
  • string | undefined
Source:

Methods

afterPageLayout(fragment)

Called after page layout to update CSS custom properties for string-set variables.

Called after page layout to update CSS custom properties for string-set variables. Computes first, last, start, and first-except string values and sets them as CSS variables.

Parameters:
Name Type Description
fragment DocumentFragment

The DOM fragment for the current page.

Source:

onContent(funcNode, fItem, fList, declaration, rule)

Processes string() CSS function nodes within content declarations, transforming them into CSS variables referencing pagedjs-generated custom properties.

Processes string() CSS function nodes within content declarations, transforming them into CSS variables referencing pagedjs-generated custom properties.

Parameters:
Name Type Description
funcNode Object

The function node representing string().

fItem Object

Function item node (unused here).

fList Object

Function list node (unused here).

declaration Object

The CSS declaration node.

rule Object

The CSS rule node.

Source:

onDeclaration(declaration, dItem, dList, rule)

Handles CSS declarations, looking specifically for string-set declarations.

Handles CSS declarations, looking specifically for string-set declarations. Parses identifiers and functions, storing them with selectors.

Parameters:
Name Type Description
declaration Object

The CSS declaration node.

dItem Object

Declaration item (unused here).

dList Object

Declaration list (unused here).

rule Object

The CSS rule node containing the declaration.

Source: