Parser
NAME
CSS::Minifier::Parser ā custom brace-counting CSS parser
DESCRIPTION
Parses raw CSS into a Document tree using brace-counting and
character-level scanning.
Handles strings (single/double quotes with escapes), comments,
braceless at-rules (@import, @charset, @namespace), and
recursive block structure for nested at-rules.
Note: CSS native nesting (e.g. & b { ... }) is not supported
and will silently misparse. Nested rulesets must be flattened
before minification. @keyframes (percentage/from/to keyframe
selectors) IS handled correctly.
Methods
parse(Str $css, Bool :$preserve-licenses --Document)> ā parses CSS and returns a Document tree. When:$preserve-licensesis True,/*! */comments are extracted intoDocument.licenses.
EXPORTED SUBS
parse-body(Str $body --List)> ā parses the body of a ruleset or declaration-only at-rule into a list of key => value Pair objects.
AUTHOR
Sasha Abbott <[email protected]>
COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under CC0.