MadLittleMods / postcss-increase-specificity

Why? Dealing with CSS you can't remove(mainly from a 3rd party). Increases specificity of selectors.
MIT License
50 stars 16 forks source link

Use `:not(#\20)` stackable root to make selectors more specific #8

Closed iamstarkov closed 7 years ago

iamstarkov commented 7 years ago

use :not(#\20), :not(.\20) and :not(\20) instead of generating unlikely appearing ids…

https://twitter.com/subzey/status/829050478721896448

Rationale: \20 is a css escape for U+0020 Space, and neither classname, nor id, nor tagname can contain a space

https://twitter.com/subzey/status/829051085885153280

I tried to solve the same issue as you in jss land, and the way to use :not(#\20) instead of :root seems to be more efficient in increasing selectors' specificity

Related:

/cc @subzey

MadLittleMods commented 7 years ago

@iamstarkov Seems reasonable. PR welcome 😀

iamstarkov commented 7 years ago

@MadLittleMods PR #9 🎉

iamstarkov commented 7 years ago

@MadLittleMods are you PR was welcomed? =)

MadLittleMods commented 7 years ago

Published in postcss-increase-specificity@0.4.0, https://www.npmjs.com/package/postcss-increase-specificity :tada:

Thanks to @subzey for the idea and @iamstarkov for the contribution #9 💖