-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Remove "no-" prefix for all properties? #808
Comments
Good call. Reckon you could help us out by putting together a pull request? This is probably where that should go: https://github.com/Modernizr/Modernizr/blob/master/src/setClasses.js |
@stucox Yea, no problem, though it'll be a couple of days before I can sort it. |
@stucox Here's my first crack, mind giving me some feedback? |
Fixed by #874 |
@heeton - I'm afraid I'm tempted to revert this change. Reopening for discussion. I think putting 1. It's likely to cause confusion. Example: .module {
background: url(background1x.jpg);
/* This won't be applied if `.no-backgroundsize` matches, right? Wrong. */
background-size: 200%;
}
.no-backgroundsize .module {
background: url(background2x.jpg);
} This looks fine at first glance, but if JS isn't supported and I've got a 2. Async tests are complicated enough when using Modernizr's styling classes. Here's a simple pattern for WebP (which is an async test) with a fallback: .no-webp .container {
background-image: url('image.jpg');
}
.webp .container {
background-image: url('image.webp');
} The 3. You can use I don't know of any case which couldn't be solved like this: .no-js .module,
.no-backgroundsize .module {
/* shared styles */
} Admittedly some cases might be much more verbose... but that's what CSS preprocessors are there to solve. All these caveats would be hard to document clearly... which usually means it's a bad idea. |
Silence for 7 months = I’m reverting this. PR incoming. |
@stucox Sorry, totally missed this :/ Yea, go ahead, I agree with your points. |
Resolved by #1122 |
Adding a manual class of "no-js" is useful for styling, and gets removed when js is enabled. It would be useful if this also happened for other properties.
For instance, if I set 'no-backgroundsize' on my page, I can style a fallback for people with older browsers OR javascript-disabled.
But, this doesn't seem to be removed once Modernizr detects that feature.
The text was updated successfully, but these errors were encountered: