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

feat(typography): New mixin to set exact baseline height of text elements. #3083

Merged
merged 4 commits into from
Jul 25, 2018

Conversation

abhiomkar
Copy link
Collaborator

@abhiomkar abhiomkar commented Jul 16, 2018

Feat required for #2783 & #3038

@abhiomkar abhiomkar requested a review from lynnmercier July 16, 2018 14:58
@abhiomkar abhiomkar changed the title Typography text baseline feat(typography): New mixin to set exact baseline height of text elements. Jul 16, 2018
@codecov-io
Copy link

codecov-io commented Jul 16, 2018

Codecov Report

Merging #3083 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3083   +/-   ##
=======================================
  Coverage   98.13%   98.13%           
=======================================
  Files         101      101           
  Lines        4444     4444           
  Branches      585      585           
=======================================
  Hits         4361     4361           
  Misses         83       83

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42c8729...2bcc4b8. Read the comment docs.

@abhiomkar abhiomkar requested a review from kfranqueiro July 18, 2018 20:38
vertical-align: 0;
}

@if $trailing {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just make this another mixin. You could have mdc-typography-top-to-baseline($distance) and mdc-typography-baseline-to-bottom($distance)

Make sense?

And once you do that I don't think you will need this offset logic...That logic is a little weird so I want to see what it looks like as two mixins before I review more.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay I looked at #3085 and I think i understand (somewhat) why this mixin's logic is more complicated than I expected it to be.

I think that mdc-list has a strange HTML structure for supporting two line lists. I think if we change that HTML markup (so that it is not mixing text elements with span elements), then we can more simply implement the baseline alignment fix.


@mixin mdc-typography-baseline-top($distance) {
margin-top: 0;
line-height: normal;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think setting line-height to normal will become unnecessary once we remove line-height from typography scale.

But for now I think it is okay.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would keep this for now. Secondary text in list and hint text on text field still has line-heights.

@mdc-web-bot
Copy link
Collaborator

🤖 Beep boop!

Screenshot test report

Commit 2bcc4b8 vs. master:

No diffs! 💯🎉

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