johanholmerin / style9

CSS-in-JS compiler inspired by Meta's stylex
MIT License
570 stars 27 forks source link

Exclude atrule type when parse css selector #42

Closed myamolane closed 3 years ago

myamolane commented 3 years ago

41

@-ms-viewport { width: device-width; }

Style9 recognizes '@-ms-view-port' as a selector rule, and tries to parse the selector. But @-ms-viewport is more like a media query, with no selector property in the object from PostCSS. Use postcss-selector-parser to parse an object without selector property will throw an exception.

johanholmerin commented 3 years ago

Looks good. Could you add a test to the ignore section of __tests__/css-sorter.js?

myamolane commented 3 years ago

Sure ~ no problem