Skip to content

Commit e305244

Browse files
authored
fix: font-family: revert/revert-layer cannot remove quotation marks (parcel-bundler#121)
1 parent 6d6c1aa commit e305244

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,7 +3636,17 @@ mod tests {
36363636
minify_test(".foo { font-family: inherit; }", ".foo{font-family:inherit}");
36373637
minify_test(".foo { font-family: inherit test; }", ".foo{font-family:inherit test}");
36383638
minify_test(".foo { font-family: 'inherit test'; }", ".foo{font-family:inherit test}");
3639+
minify_test(".foo { font-family: revert; }", ".foo{font-family:revert}");
3640+
minify_test(".foo { font-family: 'revert'; }", ".foo{font-family:\"revert\"}");
3641+
minify_test(".foo { font-family: revert-layer; }", ".foo{font-family:revert-layer}");
3642+
minify_test(".foo { font-family: revert-layer, serif; }", ".foo{font-family:revert-layer,serif}");
3643+
minify_test(".foo { font-family: 'revert', sans-serif; }", ".foo{font-family:\"revert\",sans-serif}");
3644+
minify_test(".foo { font-family: 'revert', foo, sans-serif; }", ".foo{font-family:\"revert\",foo,sans-serif}");
36393645
minify_test(".foo { font-family: ''; }", ".foo{font-family:\"\"}");
3646+
3647+
// font-family in @font-face
3648+
minify_test("@font-face { font-family: 'revert'; }", "@font-face{font-family:\"revert\"}");
3649+
minify_test("@font-face { font-family: 'revert-layer'; }", "@font-face{font-family:\"revert-layer\"}");
36403650
}
36413651

36423652
#[test]

src/properties/font.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ enum_property! {
263263
// Default is also reserved by the <custom-ident> type.
264264
// https://www.w3.org/TR/css-values-4/#custom-idents
265265
"default": Default,
266+
267+
// CSS defaulting keywords
268+
// https://drafts.csswg.org/css-cascade-5/#defaulting-keywords
269+
"revert": Revert,
270+
"revert-layer": RevertLayer,
266271
}
267272
}
268273

0 commit comments

Comments
 (0)