LeaVerou / prefixfree

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

Add a way to limit which stylesheets are processed #6139

Closed joyously closed 5 years ago

joyously commented 5 years ago

Implements #6137. Adds limit property which is boolean and reflects the existence of a data-prefix attribute on the script tag. If it is there, it affects the styles. Only those with a data-prefix attribute are processed.

LeaVerou commented 5 years ago

Hello, thanks for contributing! I'd name limit something like optIn, since this is what it does: it makes prefix-free opt in, whereas limit could be anything. Apart from that, I'm fine merging this, however keep the following in mind: Given that the need for -prefix-free is greatly diminishing (I've stopped using it in any of my projects), I'm thinking of extracting StyleFix into a separate project (since there are many more use cases for that still, e.g. polyfills etc) and use it in -prefix-free as a dependency. Possibly with a different name, since I'm not sure about "StyleFix". This was kinda the plan from the very beginning, which is why it has a separate name, but it makes even more sense now. This means that any attributes relating to prefixes in StyleFix will need to be renamed to something more general, and then possibly aliased in -prefix-free for backwards compat.

joyously commented 5 years ago

I think there is still a need for prefixfree where the older browsers have to be supported. In my case, I am using it for CSS Custom Properties and conical gradients.

LeaVerou commented 5 years ago

Thanks, PR merged!

If you're using it for conic gradients and CSS variables, you're not using -prefix-free, you're using StyleFix.

joyously commented 5 years ago

But I'm also not using any prefixes in my stylesheets and that applies to user stylesheets also. :)