postcss / postcss-custom-properties

Use Custom Properties in CSS
https://postcss.github.io/postcss-custom-properties
MIT License
595 stars 77 forks source link

Error if no previous rule or declaration exists #220

Open jednano opened 4 years ago

jednano commented 4 years ago

Error is thrown here when the rule is undefined:

https://github.com/postcss/postcss-custom-properties/blob/a250907b9ca0b336d6c0ca948a1db2fe2d145309/src/lib/is-ignored.js#L5

Fix should probably be implemented here to check if the rule exists before sending it to isBlockIgnored.

https://github.com/postcss/postcss-custom-properties/blob/a250907b9ca0b336d6c0ca948a1db2fe2d145309/src/lib/is-ignored.js#L11

Semigradsky commented 4 years ago

@jedmao could you provide css code example which generate this error?

jednano commented 4 years ago

Unfortunately, I don’t remember the scenario. Can’t believe I didn’t include that here. Sorry.