-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Move to border-box as the default CSS setting for skin elements #1444
Comments
It's not the default anywhere and probably won't be ever or at least any time soon. |
+1. There are certain responsive techniques that are simply impossible with Whoever tackles this overhaul, I would also like to see the core CSS, the default skin, and the LESS mixins factored out into three separate @import build files. And in the dist files, the core CSS should be come first, conceptually. The sequence is switched now, for no reason that I can see. |
IE < 8 default to border-box! :) And by default I mean there's no other option. Actually since the original skin was built to work in both models there are probably a number of areas we could simplify.
@mmcc has talked about doing this. Right now we use the full less file for the designer which can't do imports. But we've talked about other options.
To put the styles people should be changing first, and the ones they shouldn't be changing last. Separating concerns will help that. |
The designer could have three sections or just concat the 3 files before displaying them. |
Right, also putting the core CSS in the designer just makes things bloated, and scrolling heavier. There could be some kind of "edit core" button in the UI for people who actually needed to go there. If we can agree on an approach I will tackle the stylesheet as is. The big question is what selector approach to use.
or by exhaustively declaring every single component ever created, like:
Both work. The disadvantage of the first is selector performance. Since selectors are parsed right to left, the reverse of the way humans read them, this is not great, because it initially grabs everything on the page, then filters it all the way to root. I don't have hardcore data on this but it seems everybody warns against it. The disadvantage of the second pattern is its verbosity (the list currently runs to about 65 selectors, including pseudo-elements) and maintenance demand, arguably not a big deal but I understand the objection. I lean towards option 2 despite its ugliness. Thoughts? Not that this isn't an issue if the reset uses http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ which was dreamed up to tackle this very problem, but frameworks generally haven't gotten there yet so we obviously can't count on that. |
This is probably taking a bit of a detour on this topic, but I took a stab at breaking up the stylesheet into more manageable pieces over the weekend. Let me know what you think: https://github.com/mmcc/videojs-default-skin @heff and I also discovered you can |
Selector performance isn't really something to worry about, really, nowdays. .video-js {
box-sizing: border-box;
}
.video-js *,
.video-js *:before,
.video-js *:after {
box-sizing: inherit;
} @mmcc do we have an issue to track splitting the files up? If not, we should make one. |
Yeah, that might well be true. I just looked again, five years later, at: http://www.stevesouders.com/blog/2009/06/18/simplifying-css-selectors/ On the second page, Chrome reflows in 0 ms, FF in 20. Instantaneous. Great. I do remember older browsers choking a bit on this though. Souders' graph in the first link seems to show things start to perform OK starting with IE8. There are still a bunch of warnings about https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors says:
Is there consensus that it's okay to use nested now? If we're going to use the star selector I'd like to use: .video-js, .video-js * {box-sizing: border-box} and set the value directly because it pollutes the inspector less with that huge scrolling cascade of inherited styles. Aesthetics, really. |
The general consensus is not to worry about selector performance. It is almost always not the issue. If we find it to be an issue, we can look into changing it. |
New issue opened: #1492 |
We probably need to think through this a bit, but border-box can make certain things easier. It's not the default in most browsers though so it also might not be the best for making skinning easy, if most people are used to content-box.
@mmcc, @gkatsev
The text was updated successfully, but these errors were encountered: