Skip to content

Commit 8acae52

Browse files
authored
1 parent 6fb7729 commit 8acae52

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/lib.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22488,6 +22488,23 @@ mod tests {
2248822488
"#,
2248922489
"@layer{.bar{color:red}}",
2249022490
);
22491+
minify_test(
22492+
r#"
22493+
@layer foo\20 bar, baz;
22494+
"#,
22495+
"@layer foo\\ bar,baz;",
22496+
);
22497+
minify_test(
22498+
r#"
22499+
@layer one.two\20 three\#four\.five {
22500+
.bar {
22501+
color: red;
22502+
}
22503+
}
22504+
"#,
22505+
"@layer one.two\\ three\\#four\\.five{.bar{color:red}}",
22506+
);
22507+
2249122508
error_test("@layer;", ParserError::UnexpectedToken(Token::Semicolon));
2249222509
error_test("@layer foo, bar {};", ParserError::AtRuleBodyInvalid);
2249322510
minify_test("@import 'test.css' layer;", "@import \"test.css\" layer;");
@@ -22496,6 +22513,10 @@ mod tests {
2249622513
"@import 'test.css' layer(foo.bar);",
2249722514
"@import \"test.css\" layer(foo.bar);",
2249822515
);
22516+
minify_test(
22517+
"@import 'test.css' layer(foo\\20 bar);",
22518+
"@import \"test.css\" layer(foo\\ bar);",
22519+
);
2249922520
error_test(
2250022521
"@import 'test.css' layer(foo, bar) {};",
2250122522
ParserError::UnexpectedToken(Token::Comma),

src/rules/layer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<'i> ToCss for LayerName<'i> {
7272
dest.write_char('.')?;
7373
}
7474

75-
dest.write_str(name)?;
75+
serialize_identifier(name, dest)?;
7676
}
7777

7878
Ok(())

0 commit comments

Comments
 (0)