Class CssParser
java.lang.Object
dev.jcputney.mjml.css.CssParser
Parses CSS text into a list of
CssRule objects.
Handles:
- Regular rules (selector { declarations })
- Comments (/* ... */)
- @-rules (@media, @font-face, @keyframes) which are preserved but not parsed as rules
At-rules that should not be inlined are collected separately so they can be placed back into
<style> blocks in the output.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of parsing CSS: regular rules to inline and preserved at-rules. -
Method Summary
Modifier and TypeMethodDescriptionstatic CssParser.ParseResultParses CSS text into rules and preserved at-rules.parseRules(String css) Parses CSS text and returns only the inlineable rules (convenience method).
-
Method Details
-
parse
Parses CSS text into rules and preserved at-rules.- Parameters:
css- the CSS text to parse- Returns:
- parse result with rules and preserved at-rules
-
parseRules
-