-
-
Notifications
You must be signed in to change notification settings - Fork 324
Closed
Labels
Description
Steps to reproduce
const postcss = require("postcss");
async function main() {
const plugins = [require("postcss-minify-font-values")];
const input = 'body { font-family: "STHeiti Light [STXihei]" }';
console.log("/* Input: */\n%s", input);
const output = await postcss(plugins).process(input);
console.log("/* Output: */\n%s", output.css);
}
main();Actual behavior
/* Input: */
body { font-family: "STHeiti Light [STXihei]" }
/* Output: */
body { font-family: STHeiti Light\ [STXihei] }Output is Invaild property value
Expected behavior
/* Input: */
body { font-family: "STHeiti Light [STXihei]" }
/* Output: */
body { font-family: STHeiti Light \[STXihei\] }Reference
- https://drafts.csswg.org/css-fonts-3/#font-family-prop
- https://www.w3.org/TR/CSS22/syndata.html#strings
- https://www.w3.org/TR/CSS22/syndata.html#escaped-characters
- https://www.w3.org/TR/CSS22/syndata.html#tokenization
- https://github.com/ben-eb/cssnano/blob/77a8889fb500c1579740421d48d72bd2549b0f40/packages/postcss-minify-font-values/src/lib/minify-family.js
danmaq, aronlee and NiklasBr