diff --git a/packages/cli/src/config/postcssLinariaPreprocessor.ts b/packages/cli/src/config/postcssLinariaPreprocessor.ts index 68cdb68..16df948 100644 --- a/packages/cli/src/config/postcssLinariaPreprocessor.ts +++ b/packages/cli/src/config/postcssLinariaPreprocessor.ts @@ -77,6 +77,13 @@ const postcssLinariaPreprocessor: PluginCreator = () => ({ } } }, + Declaration(decl) { + // escape breaking control characters + // from: https://github.com/thysultan/stylis/blob/v3.5.4/tests/spec.js#L113C3-L116 + if (decl.value.match(/[\0\r\f]/)) { + decl.value = decl.value.replace(/\0/g, '\\0').replace(/\r/g, '\\r').replace(/\f/g, '\\f'); + } + }, }); postcssLinariaPreprocessor.postcss = true;