pascalduez / postcss-quantity-queries

PostCSS plugin enabling quantity-queries
The Unlicense
114 stars 4 forks source link

Selectors #2

Closed ai closed 9 years ago

ai commented 9 years ago

@pascalduez why you use at-rules? I think it is a Sassy way.

I see 2 problems:

  1. at-rules names is too common. @exactly may have confict with many other plugins, becuase maybe other plugin has some “exactly” idea.
  2. This queries is seems like a selector like :nth-child.

This is a first draft idea (with postcss-nested):

ul > li:count(6) {}
ul > li:min-count6) {}
ul > li:max-count(6) {}
ul > li:count-between(3, 4) {}
pascalduez commented 9 years ago

I think it is a Sassy way.

Well I'm still pretty Sassy ;-)

It also crossed my mind that there could be name conflicts with the at-rules, but honestly I think that risk is very low. One idea was to prefix them with something like @qq-exactly 6. More typing...

I like your idea of pseudo hooks though, I will give it a shot. Maybe keep both syntax at the user discretion. Let's see.

ai commented 9 years ago

Yeap, I think about two syntaxes too to not broke the API

pascalduez commented 9 years ago

Done in 0.2.0

ai commented 9 years ago

Awesome. Now we better that Sass mixin :D

pascalduez commented 9 years ago

Thanks for the suggestion !