Open pascalduez opened 11 years ago
Try the 0.0.2
branch. It was much more complex in it’s matching algorithms (and had holes). I built it for a project I’m on now that is mobile first and has media queries similar to @media only screen and (min-width: Xem), screen and (max-width: Yrem)
.
The reason I didn’t stay with the complex matchers is to fully support it and the range of media queries would involve much more complex matching and unit conversion and base font-size computing.
I’d be interested in trying out accepting a custom filter function (or array of them) rather than just an array of strings.
Also, maintaining a list of all MQ’s could be pretty straightforward. Config files and preprocessors alone could probably get you 80% of the way there.
As an aside, I’ll be writing a rem
--> px
unit converter soon (unless someone else beats me to it :wink).
Thanks for the quick reply. Let's see if I find some time to work on something.
Also, maintaining a list of all MQ’s could be pretty straightforward. Config files and preprocessors alone could probably get you 80% of the way there.
That's the track I'm going to try first I guess. Having Sass output the breakpoints in a format readable for js.
I’ll look into adding a custom function filter over the next week, too. Testing out the idea is just a few minutes of work; verifying it solves the problem and works correctly is a bit more :)
Thanks for this plugin which turns very useful in the pain of having to support old IE.
It would be really interesting to have more granular matches though. The way it works now with
indexOf
might not cover every needs.Let's say I'm styling mobile first, good chances are I want to keep all MQ's with
min-width
but remove the ones containing amax-width
.Maintaining a list of all MQ's to keep quickly turns impossible on large projects.
So maybe using regexps or having include / exclude parameters ?