Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pseudo-element testing API #904

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added pseudo-element testing API #904

wants to merge 2 commits into from

Conversation

willfarrell
Copy link

Added selectorSupported() from https://gist.github.com/paulirish/441842 w/ tests
Added pseudo-element reveal feature detect

… w/ tests

Added pseudo-element reveal feature detect
@stucox
Copy link
Member

stucox commented Apr 16, 2013

Cool, thanks — especially for including a test.

Including this in its current state could well result in a bit of code bloat though — we already have functions which can do a lot of this; such that e.g. our detect for :checked is only a few lines long.

I'm wondering if we could refactor this to provide the same API (selectorSupported(...)), but make use of Modernizr.testStyles like that detect does?

We could also use Modernizr._prefixes to test all the prefixes automatically, so that your detect for ::reveal could simply be:

Modernizr.addTest('reveal', selectorSupported('::reveal'));

@willfarrell
Copy link
Author

Thanks @stucox, I'll look into those functions and see what I can come up with.

@dotherightthing
Copy link

Hi,

Is selectorSupported part of Modernizr now? I have found a :checked test which uses it, but it is failing with selectorSupported is not defined.

Note that I am using a custom build of Modernizr (generated today) - is this a special option that I need to enable in my build?

Thanks,
Dan

@patrickkettner
Copy link
Member

Hey @dotherightthing nosir, this hasn't been merged, so it is not a part of the test.

Was there something in particular you were looking for?

@dotherightthing
Copy link

Hi, just updated my question :)

Cheers
Dan

@patrickkettner
Copy link
Member

Its not a part of modernizr. We already have a detect for :checked though, as @stucox mentions above.

@dotherightthing
Copy link

Hi @patrickkettner, thanks for the heads up. So do I need to copy the linked checked.js into my code, or is there some way to call this? On a side note I'm finding it quite difficult to navigate the plethora of options available in Modernizr ;-)

@patrickkettner
Copy link
Member

:[
Really sorry about that, @dotherightthing. There has been a HUGE rewrite between the current version and this one. If you are wanting to live on the cutting edge, you can download the repo, edit lib/config-all.json to be the tests you want, then run grunt. That will build a version of modernizr with the tests you want.

If you just want to cut and paste the test, you should be able to copy this bit into a custom build of modernizr from the .com builder. Just change testStyles to Modernizr.testStyles, and createElement to document. createElement.

@dotherightthing
Copy link

Hey no worries, appreciate the great work you guys are doing! :) I'll copy and paste for now, and if it's not working I'll try the other option. Cheers.

@patrickkettner
Copy link
Member

good luck!

@patrickkettner
Copy link
Member

@willfarrell - were you still interested in getting this merged in?

@willfarrell
Copy link
Author

Yeah I would, all my project have been using a custom version of moderizr for the better part of a year now. Would love to keep modernizr up to date with bower.

@patrickkettner
Copy link
Member

Great to hear! do you need any guidance?

@patrickkettner
Copy link
Member

ping @willfarrell

@willfarrell
Copy link
Author

Sorry, works been crazy. Clearly I don't have time to address carry this over the finish line. If I have time in the future I'll submit a new PR. Anyone else that would like to take it forward, please do so.

@patrickkettner
Copy link
Member

No problem at all, @willfarrell! Sorry if you felt pressured as all :[

I'll leave this open for now so we don't forget about it :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants