newlines inside @supports are the same as outside

This commit is contained in:
Connor Skees 2021-07-24 01:18:36 -04:00
parent 36411e36d3
commit b44f81bd60
2 changed files with 24 additions and 1 deletions

View File

@ -620,7 +620,7 @@ impl Formatter for ExpandedFormatter {
} }
writeln!(buf, " {{")?; writeln!(buf, " {{")?;
let css = Css::from_stmts(body, AtRuleContext::Supports, css.allows_charset)?; let css = Css::from_stmts(body, AtRuleContext::None, css.allows_charset)?;
self.write_css(buf, css, map)?; self.write_css(buf, css, map)?;
write!(buf, "\n{}}}", padding)?; write!(buf, "\n{}}}", padding)?;
} }

View File

@ -27,3 +27,26 @@ test!(
}", }",
"@supports (-ms-ime-align: auto) {\n a {\n color: red;\n }\n\n b {\n color: green;\n }\n}\n" "@supports (-ms-ime-align: auto) {\n a {\n color: red;\n }\n\n b {\n color: green;\n }\n}\n"
); );
test!(
no_newline_after_media,
"@supports (position: sticky) {
a {
color: red;
}
@media (min-width: 576px) {
a {
color: red;
}
a {
color: red;
}
}
a {
color: red;
}
}",
"@supports (position: sticky) {\n a {\n color: red;\n }\n\n @media (min-width: 576px) {\n a {\n color: red;\n }\n\n a {\n color: red;\n }\n }\n a {\n color: red;\n }\n}\n"
);