postcss-sass icon indicating copy to clipboard operation
postcss-sass copied to clipboard

Fix media query processing

Open georges-g opened this issue 1 year ago • 0 comments

There is an issue with how postcss-sass processes media queries.

It makes it impossible to use with stylelint. See the issue there.

The source should not return undefined:

> require('postcss-sass').parse('@media(max-width: 40rem)\n  color: red').nodes[0].source
undefined

> require('postcss-scss').parse('@media(max-width: 40rem) { color: red }').nodes[0].source
{
  input: Input {
    css: '@media(max-width: 40rem) { color: red }',
    hasBOM: false,
    id: '<input css FGAgvV>',
    [Symbol(fromOffsetCache)]: [ 0 ]
  },
  start: { column: 1, line: 1, offset: 0 },
  end: { column: 39, line: 1, offset: 38 }
}

georges-g avatar Sep 05 '23 13:09 georges-g