LeaVerou / prefixfree

Break free from CSS prefix hell!
http://projects.verou.me/prefixfree/
MIT License
3.83k stars 712 forks source link

Modern syntax of Custom Properties (CSS variables) affects check for prefix #6129

Closed joyously closed 5 years ago

joyously commented 6 years ago

This line is supposed to be checking properties for prefixes, but it will also match CSS variables. https://github.com/LeaVerou/prefixfree/blob/0d3d2a0e6656316f385cd1d57559a19bcbbf2c57/prefixfree.js#L281

joyously commented 6 years ago

Would a good solution be if (property.charAt(0) === '-') && (property.charAt(1) !== '-') {

?

LeaVerou commented 6 years ago

@joyously Yup, that should work.

Or, even better, a regex:

if (/^-[^-]/.test(property))