red-perfume / red-perfume-css

Library for atomizing strings of CSS
https://red-perfume.github.io
MIT License
3 stars 0 forks source link

Parsing errors #16

Closed TheJaredWilcurt closed 1 year ago

TheJaredWilcurt commented 1 year ago

Passing in some valid CSS from Bootstrap 2: Code:

const redPerfumeCss = require('./index.js');
const input = `
@media (min-width:768px) and (max-width:979px) {
  .hidden-tablet { display:none!important }
}
`;
const results = redPerfumeCss({ input });

Error:

_________________________
Red-Perfume-CSS:
Error parsing CSS. TypeError: Cannot read properties of undefined (reading 'join')
    at red-perfume-css\src\css-parser.js:107:58
    at Array.forEach (<anonymous>)
    at cssParser (red-perfume-css\src\css-parser.js:106:29)
    at atomize (red-perfume-css\src\atomize.js:266:14)
    at redPerfumeCss (red-perfume-css\index.js:19:10)
    at Object.<anonymous> (red-perfume-css\manual-testing.js:249:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)

I assume this is related to the media query syntax in some manner. Needs further investigation.

TheJaredWilcurt commented 1 year ago

Will be fixed by #13