Skip to main content

Module custom_function

Module custom_function 

Source
Expand description

Port of src/ast/mixins/custom-function.ts: a custom function call (<dashed-function>) is replaced by the result of the function, like var() is replaced by the value of a custom property (https://drafts.csswg.org/css-mixins-1/#defining-custom-functions).

The registry is shared by the scopes (Rc): its counters and sets are interior mutable.

Structs§

FunctionDefinition
custom function definition
FunctionRegistry
evaluates the custom function calls (FunctionRegistry)

Functions§

evaluate_functions
replace the custom function calls of the declarations of a stylesheet with their result. the bodies of the mixins and of the custom functions are evaluated when they are used
find_calls
the custom function calls of a list of tokens and their descendants
parse_function
parse a custom function definition. None if the prelude is not valid