-
Notifications
You must be signed in to change notification settings - Fork 92
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
:is() & :where() use cases #272
Comments
Be careful with specitify and |
For now on, I can't think about a test that wouldn't be writable without However I already found some tests which would be shorter with it. Be careful with this, since ending a selector with a ErrorsNested interactive elements:matches(a, button) :matches(a[href], audio[controls], video[controls], button, details, embed, iframe, img[usemap], label, select, textarea, input[type]:not([hidden])) [width] & [height] attributes:not(:matches(img, object, embed, svg, canvas)):matches([width], [height]) Table used for layouttable[role="presentation"] :matches(th, thead, tfoot, caption, colgroup, [axis], [scope], [headers]) Button not submittingbutton:matches([type="reset"], [type="button"]):matches([formmethod], [formaction], [formtarget],[formenctype], [formnovalidate]) Missing a valueinput:matches([type="reset"], [type="button"]], [type="submit"]):not([value]):not([title]):not([aria-label]):not([aria-labelledby]) Missing source for img:matches(img, input[type="image"]):not([src]):not([srcset]),
:matches(img, input[type="image"]):matches([src=""], [src=" "], [src="#"], [src="/"]),
:matches(img, input[type="image"]):matches([srcset=""], [srcset=" "], [srcset="#"], [srcset="/"]) Missing alternative for img:matches(img, area, input[type="image"]):not([alt]),
:matches(img, area, input[type="image"]):matches([alt=" "]) WarningsInvalid nesting in a list:not(ul):not(ol) > li,
:matches(ul, ol) > :not(li) The same for defintion list, obvisouly. Misplaced div:matches(b, i, q, em, abbr, cite, code, span, small, label, strong) div [alt] containing file name:matches(img, area, input[type="image"], embed[type="image"], object[type="image"]):matches([alt$=".pdf"], [alt$=".doc"], [alt$=".png"], [alt$=".jpg"], [alt$=".gif"] Note: I shortened filename list :) I won't do all of them but it would be pretty easy :) |
According to the MDN browser compatibility table, I think we gotta go :) |
Uh oh, |
|
Looks familiar, isn't it? Formerly known as
:any()
, it came back from outterspace as:matches()
.And it starts to be pretty well supported.
The text was updated successfully, but these errors were encountered: