Constructor
new PageCounterIncrement(chunker, polisher, caller)
Constructs a PageCounterIncrement handler.
Constructs a PageCounterIncrement handler.
Parameters:
Name | Type | Description |
---|---|---|
chunker |
Object | The chunker instance used during pagination. |
polisher |
Object | The polisher instance used for styling. |
caller |
Object | The caller coordinating the handlers. |
Members
pageCounter :Object
Tracks page counter increments and resets by selector.
Tracks page counter increments and resets by selector. Only the "page" counter is processed.
Type:
- Object
styleSheet :CSSStyleSheet
Type:
- CSSStyleSheet
Methods
afterParsed(_)
Hook called after parsing is complete.
Hook called after parsing is complete. Applies the processed counter-increments as CSS custom properties.
Parameters:
Name | Type | Description |
---|---|---|
_ |
* | Unused parameter (parsed content). |
handleIncrement(declaration, rule) → {Object|undefined}
Parses a counter-increment
declaration and determines if it's relevant.
Parses a counter-increment
declaration and determines if it's relevant.
Parameters:
Name | Type | Description |
---|---|---|
declaration |
Object | The |
rule |
Object | The parent rule node. |
Returns:
The parsed increment object or undefined if ignored.
- Type
- Object | undefined
insertRule(rule)
Inserts a rule into the active stylesheet.
Inserts a rule into the active stylesheet.
Parameters:
Name | Type | Description |
---|---|---|
rule |
string | The CSS rule string to insert. |
onDeclaration(declaration, dItem, dList, rule)
Handles CSS declarations during parsing.
Handles CSS declarations during parsing.
Specifically looks for counter-increment: page
and collects them.
Parameters:
Name | Type | Description |
---|---|---|
declaration |
Object | The CSS declaration AST node. |
dItem |
Object | The item in the declaration list. |
dList |
Object | The list of declarations. |
rule |
Object | The parent rule node. |