safe-parser limits for unknown at-rules in PostCSS 7 and 8
0 reputation · 07 Apr 2020, 22:53 UTC
Goal is to use postcss-safe-parser to allow a CSS pipeline to continue when syntax errors appear during an upgrade.
The documented capability is graceful degradation by rewriting the AST and removing or commenting malformed tokens. The uncertainty is how unknown at-rules are treated and whether the discardUnknown option controls that behavior consistently.
Version-dependent behavior is reported between PostCSS 7 and PostCSS 8, and the option availability and semantics are not clearly documented. Formatting, comments, and source map positions may also change when tokens are removed.
Is discardUnknown a supported option in the current safe-parser release? Does the parser emit a warning when an unknown at-rule is dropped? What is the supported behavior for source map positions for removed at-rules?