reworkcss / css

CSS parser / stringifier for Node.js
MIT License
1.58k stars 251 forks source link

Nested at-rules stringified with incorrectly (indentation-wise) #134

Open Andarist opened 4 years ago

Andarist commented 4 years ago

code

const { parse, stringify } = require('css')
console.log(stringify(parse(`@media (min-width: 980px){.css-18m403-cls{background-color:blue;}@supports (width: 100vw){.css-18m403-cls{background-color:red;}}}`)))

actual

@media (min-width: 980px) {
  .css-18m403-cls {
    background-color: blue;
  }

@supports (width: 100vw) {
    .css-18m403-cls {
      background-color: red;
    }
}
}

expected

@media (min-width: 980px) {
  .css-18m403-cls {
    background-color: blue;
  }
  @supports (width: 100vw) {
    .css-18m403-cls {
      background-color: red;
    }
  }
}