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

Recent 'box-sizing' change brakes button appearance #57

Closed
dzhioev opened this issue Oct 22, 2015 · 4 comments
Closed

Recent 'box-sizing' change brakes button appearance #57

dzhioev opened this issue Oct 22, 2015 · 4 comments

Comments

@dzhioev
Copy link

dzhioev commented Oct 22, 2015

Hello,
in a6041a2 box-sizing of the :host was changed from content-box to border-box and 'width' was increased by the doubled padding, to compensate the box sizing model change.

I have a page which includes . The button has custom padding:

paper-icon-button {
  padding: 0;
}

Before the change, effective CSS applied to :host was:

padding: 0;
width: 24px;

After the change it became:

padding: 0;
width: 40px;

As a result the button became 1.5x larger.

In fact this change affects every existing <paper-icon-button> with customized width and/or padding.

@danbeam
Copy link
Contributor

danbeam commented Oct 22, 2015

/cc @notwaldorf

@notwaldorf
Copy link
Contributor

Hmm, the reason we changed that is that a global * style would break the internal style (and because of Paul Irish's blog post, a lot of people are doing * { box-sizing: border-box}), so we tried to make it less brittle. The alternative was hardcoding it to content-box, which was not great.

I'm not sure how we could have unbroken people and still fixed it. :(
I think the best thing is to update the size -- i'm not sure rolling it back now is worth it, since it's been out for a week, and I think a lot of people already updated. I am really sorry about breaking your styles, though :(

Let me know if there was a better way to fix this that I missed.

@dzhioev
Copy link
Author

dzhioev commented Oct 22, 2015

Hardcoding it to content-box seem like a better solution to me. Why did you prefer border-box? Even if setting * { box-sizing: border-box} is common, I don't believe it's a majority. So hardcoding content-box will affect less users.

@notwaldorf
Copy link
Contributor

I think content-box is generally bad (there's a bunch of articles on this), because that's not how the CSS box model really works. :(

Again, I am very sorry for the breaking change. I've checked and everywhere else where we hard code sizes we also use the right box-sizing, so hopefully this will never happen again.

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