new CSSTransformerBase()
Internal state initializer.
To apply transformer use CSSTransformerBase.transform(el) instead.
Methods
-
static transform(el)
-
Transform AST using this transformer.
Parameters:
Name Type Description elASTNode | Array.<ASTNode> Element.
-
atRule(el, i, parentChildren, cbnullable)
-
At rule transformer.
Parameters:
Name Type Attributes Description elAtRule Element.
inumber Element index.
parentChildrenArray.<ASTNode> Element's parent children list.
cbfunction <nullable>
Callback.
-
comment(el, i, parentChildren, cbnullable)
-
Comment transformer.
Parameters:
Name Type Attributes Description elComment Element.
inumber Element index.
parentChildrenArray.<ASTNode> Element's parent children list.
cbfunction <nullable>
Callback.
-
declaration(el, i, parentChildren, cbnullable)
-
Declaration transformer.
Parameters:
Name Type Attributes Description elDeclaration Element.
inumber Element index.
parentChildrenArray.<ASTNode> Element's parent children list.
cbfunction <nullable>
Callback.
-
getTransformer(el) → {function}
-
Get node transformer.
Parameters:
Name Type Description elASTNode Element.
Returns:
function -Node transformer.
-
root(el, inullable, parentChildrennullable, cbnullable)
-
Root node transformer.
Parameters:
Name Type Attributes Description elArray.<Rule> Root element.
inumber <nullable>
Root element index if any.
parentChildrenArray.<ASTNode> <nullable>
Children of root element parent if there is any parent.
cbfunction <nullable>
Callback.
-
rule(el, i, parentChildren, cbnullable)
-
Rule transformer.
Parameters:
Name Type Attributes Description elRule Element.
inumber Element index.
parentChildrenArray.<ASTNode> Element's parent children list.
cbfunction <nullable>
Callback.
-
transformSubElements(elements, listnullable, whitelistnullable)
-
Transform all (or with exclusions) provided sub elements.
Parameters:
Name Type Attributes Description elementsArray.<ASTNode> Array of elements.
listArray.<string> <nullable>
Blacklist or whitelist of types.
whitelistboolean <nullable>
Whether list is whitelist or blacklist.