DEV Community

Discussion on: PostCSS Functional CSS Plugin. Generate Functional CSS with ease.

Collapse
 
iamfrntdv profile image
Eduard Pochtar πŸ‘¨β€πŸ’»

What do you mean by a css hack in this case?

Collapse
 
equinusocio profile image
Mattia Astorino

You should not put special characters inside class selectors. Every symbol you use like :@ etc is mus be escaped with \ to avoid parser errors. So in fact it’s not valid css and if vendors change their css parser you might need to rewrite all.

Thread Thread
 
iamfrntdv profile image
Eduard Pochtar πŸ‘¨β€πŸ’»

it's just an example, you can use what you prefer, that's why there is a config.)

But it's a valid class in html... ;)
You can even use emojis in your class names, because why not?)

Thread Thread
 
equinusocio profile image
Mattia Astorino • Edited

Is a common practice to use not valid characters in functional css (or acss). It’s not just about this example. Nothing personal. Btw, emoji are valid characters for css selectors, symbols aren’t .

Thread Thread
 
iamfrntdv profile image
Eduard Pochtar πŸ‘¨β€πŸ’»

what separator do you suggest?

Thread Thread
 
equinusocio profile image
Mattia Astorino

Any valid charcter that doesn’t require escaping

Thread Thread
 
iamfrntdv profile image
Eduard Pochtar πŸ‘¨β€πŸ’»

ok, I'll update example here, on github and later on npm.