preserve space before non-parenthesized media query expression - fixes #759

pull/765/head
Rich Harris 7 years ago
parent dff1cb5fe3
commit 9d8f4d341d

@ -144,7 +144,8 @@ class Atrule {
minify(code: MagicString, cascade: boolean) {
if (this.node.name === 'media') {
let c = this.node.start + 6;
const expressionChar = code.original[this.node.expression.start];
let c = this.node.start + (expressionChar === '(' ? 6 : 7);
if (this.node.expression.start > c) code.remove(c, this.node.expression.start);
this.node.expression.children.forEach((query: Node) => {

@ -0,0 +1 @@
@media only screen and (min-width: 400px){[svelte-xyz].large-screen,[svelte-xyz] .large-screen{display:block}}

@ -0,0 +1,9 @@
<div class='large-screen'>animated</div>
<style>
@media only screen and (min-width: 400px) {
.large-screen {
display: block;
}
}
</style>
Loading…
Cancel
Save