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(toolbar): Fix icon padding for ripples, and vertical alignment in FF/IE/Edge #2138

Merged
merged 21 commits into from
Feb 23, 2018

Conversation

kfranqueiro
Copy link
Contributor

@kfranqueiro kfranqueiro commented Jan 30, 2018

  • Change align-items to center for toolbar section element to fix vertical alignment in IE/Edge and also mitigate the adjustments to vertical padding in this PR
  • Adjust vertical padding on toolbar items so that ripples applied to icons don't extend further than they should
  • Add margin instead of increasing padding on leading and last toolbar icons, again to avoid excessive ripple size

This should not cause a visible difference in icon padding/arrangement (other than vertically aligning it properly in IE/Edge).

Fixes #1067 (finally)
Also fixes #1296 related to vertical alignment (I re-checked and indeed it's not just IE/Edge, it affects FF too, huh.)

@kfranqueiro kfranqueiro changed the title fix(toolbar): Fix icon padding for ripples, and vertical alignment in IE/Edge fix(toolbar): Fix icon padding for ripples, and vertical alignment in FF/IE/Edge Jan 30, 2018
<a href="#" class="material-icons mdc-toolbar__icon" aria-label="Download" alt="Download">file_download</a>
<a href="#" class="material-icons mdc-toolbar__icon" aria-label="Print this page" alt="Print this page">print</a>
<a href="#" class="material-icons mdc-toolbar__icon" aria-label="Bookmark this page" alt="Bookmark this page">bookmark</a>
<a href="#" class="material-icons mdc-toolbar__icon mdc-ripple-surface demo-toolbar-surface" data-mdc-ripple-is-unbounded aria-label="Download" alt="Download">file_download</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we call @include mdc-states(text-primary-on-primary) from within the CSS for mdc-toolbar__icon? And then remove this mdc-ripple-surface from the demo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can probably add ripple styles to mdc-toolbar__icon if it's safe to assume all toolbar icons are intended to be interactable (which I think is the case judging by the spec).

If I do that, I should probably also add logic to toolbar's JS to instantiate ripples for its icons.

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 we should do that.

@lynnmercier lynnmercier self-assigned this Jan 31, 2018
@kfranqueiro kfranqueiro self-assigned this Jan 31, 2018
@kfranqueiro
Copy link
Contributor Author

kfranqueiro commented Feb 2, 2018

I just realized the fix this branch includes for #1296 (and also to support the main fix for #1067) actually causes problems for flexible toolbar, so I might need to find a different way to fix the vertical alignment...

@kfranqueiro
Copy link
Contributor Author

@williamernest was cool enough to find a resolution to the snag I ran into with flexible toolbar, and I've committed the rest of my stuff on top of that. Will's now hammering out one remaining issue but then I think this is ready for review again.

@codecov-io
Copy link

codecov-io commented Feb 23, 2018

Codecov Report

Merging #2138 into master will decrease coverage by 0.17%.
The diff coverage is 22.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2138      +/-   ##
==========================================
- Coverage   99.21%   99.04%   -0.18%     
==========================================
  Files          99       99              
  Lines        3967     3976       +9     
  Branches      510      510              
==========================================
+ Hits         3936     3938       +2     
- Misses         31       38       +7
Impacted Files Coverage Δ
packages/mdc-toolbar/constants.js 100% <ø> (ø) ⬆️
packages/mdc-toolbar/index.js 82.5% <22.22%> (-17.5%) ⬇️

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 b996b7f...5a04b69. Read the comment docs.

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.

Vertical alignment issues in nav bar icons Correct unbounded ripple diameter
4 participants