This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use flex to center text both horizontally and vertically (#115)
- Loading branch information
dddb834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that broke so many things! do you even test?
bring back text-align: center;
dddb834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jannakha Can you give us a reproduction? From what I see
--layout-center-center
gives the same result: http://jsbin.com/qedecequpa/edit?html,outputdddb834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NO it doesn't, especially when you have a bit more complex layout inside the button with icons.
You've added inline-flex as well! here's a before and after screenshots:
before:
![screen shot 2016-05-25 at 10 00 38 am](https://cloud.githubusercontent.com/assets/1356783/15523801/7ddf21da-2260-11e6-9b3f-c90f9c062278.png)
after:
There are more important bugs (some of which my team has reported) in Polymer than layout of paper button. We even did some pull requests - and ZERO response. It's a bit frustrating :-(
dddb834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jannakha The reason why we switched to inline-flex was because we wanted to, by default, vertically center button contents (#113). We definitely did not intend for this to be a breaking change, and we didn't foresee this case. Going forward, to accomplish the vertical layout you've shown, I would suggest applying
flex-direction: column
(or@apply(--layout-vertical); @apply(--layout-inline);
); see http://jsbin.com/guteqeteka/edit?html,output . Please feel free to file/bump any outstanding issues/PRs so that the element maintainer can respond to them.dddb834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have already fixed this issue with @apply(--layout-vertical); in my project. Just something unexpected.
dddb834
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change broke use cases like the following one:
Previously, the button text will be aligned to the left, after this change, the whole button will be centered inside the container.
To fix this, the user is now required to reset
display: inline-block
on thepaper-button