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

fix(typography): Reverted baseline mixin to use display inline-block #3297

Merged
merged 3 commits into from
Aug 3, 2018

Conversation

abhiomkar
Copy link
Collaborator

@abhiomkar abhiomkar commented Aug 3, 2018

Flexbox works differently with pseudo elements on Chrome/FF vs IE/Edge. Reverted mixin to use display inline-block.

BREAKING CHANGE: Updates to typography baseline mixin which requires the text element to strip the white-space. Helper text and MDC List two line text should strip the white-space.

@abhiomkar abhiomkar changed the title feat(typography): Reverted baseline mixin to use display inline-block fix(typography): Reverted baseline mixin to use display inline-block Aug 3, 2018

<h2 class="demo-typography__title mdc-typography--headline6">Our Changing Planet</h2>
<h3 class="demo-typography__subtitle mdc-typography--subtitle2">by Kurt Wagner</h3>
<div class="demo-typography__body mdc-typography--body2">Visit ten places on our planet that are undergoing the biggest changes today.</div>
<line class="demo-typography-line-1">+34px</line>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using a non-standard <line> element instead of a <div> or something?

@@ -77,6 +77,8 @@ in the double line list style as defined by
</ul>
```

> NOTE: Make sure there are no white-space characters before primary and secondary text content.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there another way to implement these mixins that doesn't choke on whitespace?

I suspect a lot of people are going to run into this, and it's going to take them a while to figure out why their UI suddenly broke.

Copy link
Contributor

@kfranqueiro kfranqueiro Aug 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like there to be a way, but flex-box was the one way we figured...but that causes the current problem where IE and Edge don't work correctly, and for now we'd rather make the feature work everywhere.

The odd bit is if anything, I'd say IE and Edge are working as I'd expect all browsers to. It's more of a mystery to me why switching to flex still worked in the others.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the baseline struts (before & after pseudo elements) use display: inline-block it leaves extra space around before the text when white-space characters are inserted. We avoided this problem by using flex box before but IE / Edge renders them differently on pseudo elements.

It shouldn't create any issues for users who are using frameworks while vanilla component users should use this with caution.

@mdc-web-bot
Copy link
Collaborator

All 176 screenshot tests passed for commit 6b6a943 vs. master! 💯🎉

Copy link
Contributor

@acdvorak acdvorak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure to include BREAKING CHANGE in the squash commit message

@abhiomkar abhiomkar merged commit ded07d0 into master Aug 3, 2018
@abhiomkar abhiomkar deleted the fix/typography_baseline_ie_edge branch August 3, 2018 21:03
acdvorak added a commit that referenced this pull request Aug 3, 2018
@jamesmfriedman jamesmfriedman mentioned this pull request Aug 23, 2018
48 tasks
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

Successfully merging this pull request may close these issues.

4 participants