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

Remove global box-sizing and universal selector #2

Open
shchukin opened this issue May 24, 2016 · 6 comments
Open

Remove global box-sizing and universal selector #2

shchukin opened this issue May 24, 2016 · 6 comments

Comments

@shchukin
Copy link

shchukin commented May 24, 2016

Hello.

Maybe it is not such a good idea to use box-sizing: border-box globally. Should use it only where it is needed. Let's keep it as default content-box because this is what developers expect.

The universal selector is know to be slow and this is agains motherfucking ideas.

Here is a pull request.

@BafS
Copy link
Owner

BafS commented May 24, 2016

Hi,

Interesting point but the default box sizing is not really intuitive and almost every framework and dev use box-sizing and it's available almost everywhere but I am open to the idea.

Concerning the performance, I quote Paul Irish

You might get up in arms about the universal * selector.

Apparently you’ve heard its slow. Firstly, it’s not. It is as fast as h1 as a selector. It can be slow when you specifically use it like .foo > *, so don’t do that.

paulirish.com/2012/box-sizing-border-box-ftw

@shchukin
Copy link
Author

shchukin commented May 25, 2016

default box sizing is not really intuitive

It isn't. I agree. But it is default and here is a point. Now we, developers, separated into two camps, like Villariba and Villabajo. And sometimes we need to work together, our plugins and frameworks have to work together as well. Only one way to do it is to use standards, specifications and defaults.
On the other hand it doesn't bring much troubles to calculate few paddings, really.

What for universal selector it is not a big disadvantage, but still disadvantage :)

@shchukin
Copy link
Author

From the other side if you use default content-box in framework I can use both of content-box or border-box in my project. If you set framework box-sizing to border-box I can use only border-box.

@roxkisrover
Copy link

roxkisrover commented May 25, 2016

Just my 2 cents. Every framework is and should be opinionated. You can not fit to every case possible with it. So if you don't like the default behaviour, you customize it for your needs. Especially if the code base is that small.

@BafS
Copy link
Owner

BafS commented May 30, 2016

Thanks for your feedbacks. I agree with @roxkisrover, I think that it is impossible to please everybody and in my humble opinion, I prefer border-box also because almost every framework use it so it's easy to shift.
It is hard do decide...

@shchukin
Copy link
Author

@BafS it is up to you of course, but you get it wrong. In case of framework you can please everybody. Just don't change default box-sizing. And all those frameworks you mention could do it as well. It will fit anyone if you use padding-box only in selectors you really need.

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

No branches or pull requests

3 participants