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(snackbar): Drop mdc-button from snackbar's dependency #1292

Merged
merged 2 commits into from
Sep 14, 2017

Conversation

yeelan0319
Copy link
Contributor

@yeelan0319 yeelan0319 commented Sep 12, 2017

BREAKING CHANGE: Removed the dependency of mdc-button from DOM structure of snackbar.

Dev server: 1292-dot-mdc-web-dev.xxxx.com

Background

The rationale behind dropping button from snackbar is action-button is not technically a MDC button from the design perspective.

So to prevent future regression, we remove the dependency of button from snackbar by directly styling action button. The changes increase CSS file by 10 lines, but the actual size remained same 10KB.

@codecov-io
Copy link

codecov-io commented Sep 12, 2017

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1292   +/-   ##
======================================
  Coverage    99.9%   99.9%           
======================================
  Files          69      69           
  Lines        3314    3314           
  Branches      409     409           
======================================
  Hits         3311    3311           
  Misses          3       3

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 84b8877...6548a9b. Read the comment docs.

@yeelan0319 yeelan0319 force-pushed the fix/snackbar-action-button-regression branch from 0724b1b to 95e9388 Compare September 12, 2017 23:08
@yeelan0319 yeelan0319 changed the title fix(snackbar): Fix snackbar action button caused by new button mixins fix(snackbar): Drop mdc-button from snackbar's dependency Sep 12, 2017
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.

This mostly looks good but I noticed one thing that seemed odd.

@include mdc-theme-prop(color, secondary);

@include mdc-theme-dark(".mdc-snackbar") {
@include mdc-theme-prop(color, primary);
}

@include mdc-rtl-reflexive-box(margin, right, -16px, ".mdc-snackbar");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this line removed? This effectively shifts the action button to the left 16px.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line used to be the mechanism to reverse padding introduce by button, since now there is no longer padding: 0 16px, we also could safely remove the margin-direction: -16px here.

Could you take a look at the deployed dev server and see if this style looks correct to you?

Copy link
Contributor

@amsheehan amsheehan left a comment

Choose a reason for hiding this comment

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

It appears like the spacing isn't the same between the start aligned LTR and RTL contexts. It looks like the leading margin the LRT and the trailing margin in RTL are different. Attaching screen shots

@amsheehan
Copy link
Contributor

screen shot 2017-09-14 at 11 08 56 am
screen shot 2017-09-14 at 11 08 59 am

@yeelan0319
Copy link
Contributor Author

Good catch, seems like Chrome add some padding by default to button. My overlook indeed! Thanks @amsheehan

BREAKING CHANGE: Removed the dependency of mdc-button from DOM structure of snackbar.
@yeelan0319 yeelan0319 force-pushed the fix/snackbar-action-button-regression branch from 95e9388 to 6548a9b Compare September 14, 2017 15:35
@yeelan0319 yeelan0319 dismissed kfranqueiro’s stale review September 14, 2017 15:53

Sorry Ken to dismiss your review. Feel relax to rest at home :)

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 think @amsheehan's observation may have coincided with my own, and it looks like it's resolved now. Thanks both of you!

@yeelan0319 yeelan0319 merged commit be502c8 into master Sep 14, 2017
@yeelan0319 yeelan0319 deleted the fix/snackbar-action-button-regression branch September 14, 2017 16:46
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