Merge pull request #765 from sveltejs/gh-759

preserve space before non-parenthesized media query expression
pull/770/head
Rich Harris 8 years ago committed by GitHub
commit 2b41b83752

@ -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){div[svelte-xyz],[svelte-xyz] div{color:red}}

@ -0,0 +1,9 @@
<div>hello</div>
<style>
@media only screen and (min-width: 400px) {
div {
color: red;
}
}
</style>
Loading…
Cancel
Save