Open MadLittleMods opened 8 years ago
@MadLittleMods cool, I didn't realize this plugin existed!
A couple thoughts:
postcss-ascending-specificity
? Just a thought, obviously it's your call, but I'm afraid it might be confusing with so many options.And then a few wish-list items:
X.Y.Z
, which you could use something like semvar to compare -- even though that's not really what it's used for :)[id="some-id"]
is slower than #some-id
. For people who care about that difference, you could add an option to set a root ID, allowing you to prepend something like #root#root:root:root:root
to overcome ID specificity.Also, I'd be happy to be cc'ed on a PR and discuss more there. Thanks for doing this!
API discussion welcome :grinning:
options.mode
additive
: Adds the same amount of specificity to each selector (this functionality is what the plugin currently handles, seeoptions.repeat
always-ascending
: Specificity that matches the source order. See http://philipwalton.com/articles/do-we-actually-need-specificity-in-css/options.useAttributeIds
: Whether to transform#foo
into[id="foo"]
. Somehow, maybe this should be attached tooptions.mode -> always-ascending
as the article explainscc @philipwalton