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(top-app-bar): Change margin-top to padding-top to prevent margin collapse #2643

Merged
merged 2 commits into from
Apr 27, 2018

Conversation

williamernest
Copy link
Contributor

Fixes an issue with the fixed-adjust classes being susceptible to margin collapsing by changing margin-top to padding-top

@codecov-io
Copy link

codecov-io commented Apr 25, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2643   +/-   ##
=======================================
  Coverage   98.48%   98.48%           
=======================================
  Files          98       98           
  Lines        4230     4230           
  Branches      537      537           
=======================================
  Hits         4166     4166           
  Misses         64       64

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 75fe98d...3ac8454. Read the comment docs.

@kfranqueiro
Copy link
Contributor

Is the idea behind this to effectively "carry over" e.g. body margin so that it applies after / in addition to the adjustment? It took me a few minutes to understand why we would not want margin collapsing.

@williamernest
Copy link
Contributor Author

Margin collapsing causes the top app bar to initially render 64px from the top of the page when using the mdc-top-app-bar--fixed-adjust class on a sibling element unless you use &nbsp; to separate them.

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

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

I'm baffled at the bug this is fixing, but the fix seems OK.

@williamernest williamernest merged commit 8bba12d into master Apr 27, 2018
@williamernest williamernest deleted the fix/top-app-bar/change-adjust-classes branch April 27, 2018 15:39
@cheng93
Copy link

cheng93 commented May 4, 2018

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