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(textfield): add separate classes for leading/trailing icons #5367

Merged
merged 9 commits into from
Jan 8, 2020

Conversation

asyncLiz
Copy link
Contributor

BREAKING_CHANGE: icons must use .mdc-text-field__leading-icon or .mdc-text-field__trailing-icon classes. mdc-text-field-icon-color() mixin has been split into mdc-text-field-leading-icon-color() and mdc-text-field-trailing-icon-color().

@asyncLiz asyncLiz self-assigned this Dec 19, 2019
@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit 2167ee0 vs. master! 💯🎉

@codecov-io
Copy link

codecov-io commented Dec 20, 2019

Codecov Report

Merging #5367 into master will increase coverage by 1.43%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5367      +/-   ##
==========================================
+ Coverage   97.22%   98.66%   +1.43%     
==========================================
  Files         164      163       -1     
  Lines        6267     6281      +14     
  Branches      834      850      +16     
==========================================
+ Hits         6093     6197     +104     
+ Misses        174       84      -90
Impacted Files Coverage Δ
packages/mdc-textfield/constants.ts 100% <ø> (ø) ⬆️
packages/mdc-textfield/component.ts 99% <100%> (+0.99%) ⬆️
testing/helpers/foundation.ts 87.23% <0%> (-1.23%) ⬇️
packages/mdc-menu/foundation.ts 95.55% <0%> (-1.04%) ⬇️
packages/mdc-menu-surface/foundation.ts 99.12% <0%> (-0.88%) ⬇️
packages/mdc-list/foundation.ts 98.82% <0%> (-0.78%) ⬇️
...ages/mdc-textfield/character-counter/foundation.ts 100% <0%> (ø) ⬆️
packages/mdc-switch/constants.ts 100% <0%> (ø) ⬆️
packages/mdc-textfield/foundation.ts 100% <0%> (ø) ⬆️
packages/mdc-switch/foundation.ts 100% <0%> (ø) ⬆️
... and 17 more

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 784fa79...e761a87. Read the comment docs.

Copy link
Contributor

@patrickrodee patrickrodee left a comment

Choose a reason for hiding this comment

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

Overall comment: let's leave the mdc-text-field__icon element class on the icons but add the mdc-text-field__icon--trailing or mdc-text-field__icon--leading modifier classes. It'll allow us to keep generalized behavior but also apply variant-specific behavior where necessary.

@asyncLiz
Copy link
Contributor Author

Overall comment: let's leave the mdc-text-field__icon element class on the icons but add the mdc-text-field__icon--trailing or mdc-text-field__icon--leading modifier classes. It'll allow us to keep generalized behavior but also apply variant-specific behavior where necessary.

@patrickrodee does that make sense for the long term though? A lot of the shared styles right now have to deal with absolute positioning, which will go away. In the end the only shared styles will be for the cursor and scaling with density.

It's still a breaking change since we need the leading/trailing modifiers, and it feels like an unnecessary class to me at that point.

@patrickrodee
Copy link
Contributor

@asyncLiz Yeah, let's keep the existing mdc-text-field__icon class and add the mdc-text-field__icon--leading/trailing classes. Having an element class on both is good future proofing and better follows BEM.

@asyncLiz
Copy link
Contributor Author

Would we want to do something similar for prefix/suffix?

<span class="mdc-text-field__affix mdc-text-field__affix-prefix">$</span>

@patrickrodee
Copy link
Contributor

@asyncLiz Yeah, something similar with prefix/suffix would be a good idea.

@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit dc81574 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 728 screenshot tests passed for commit 3bf0ec9 vs. master! 💯🎉

packages/mdc-textfield/icon/_mixins.scss Outdated Show resolved Hide resolved
packages/mdc-textfield/_mixins.scss Outdated Show resolved Hide resolved
packages/mdc-textfield/_mixins.scss Show resolved Hide resolved
@asyncLiz asyncLiz requested a review from patrickrodee January 6, 2020 15:31
@asyncLiz asyncLiz force-pushed the fix/textfield/leading-trailing-icon-classes branch from 119febc to 41d5d91 Compare January 6, 2020 15:40
@mdc-web-bot
Copy link
Collaborator

All 698 screenshot tests passed for commit 41d5d91 vs. master! 💯🎉

@asyncLiz asyncLiz requested a review from patrickrodee January 6, 2020 20:08
@asyncLiz asyncLiz force-pushed the fix/textfield/leading-trailing-icon-classes branch from 357049e to 5dbfcc3 Compare January 6, 2020 20:20
@mdc-web-bot
Copy link
Collaborator

All 704 screenshot tests passed for commit 5dbfcc3 vs. master! 💯🎉

Copy link
Contributor

@patrickrodee patrickrodee left a comment

Choose a reason for hiding this comment

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

🔥

@abhiomkar
Copy link
Collaborator

@asyncLiz nit: BREAKING_CHANGE => BREAKING CHANGE when your squash & merge in commit description to show up on CHANGELOG.

BREAKING_CHANGE: icons must use `.mdc-text-field__leading-icon` or `.mdc-text-field__trailing-icon` classes. `mdc-text-field-icon-color()` mixin has been split into `mdc-text-field-leading-icon-color()` and `mdc-text-field-trailing-icon-color()`.
@asyncLiz asyncLiz force-pushed the fix/textfield/leading-trailing-icon-classes branch from 5dbfcc3 to 1988a4a Compare January 8, 2020 19:41
@mdc-web-bot
Copy link
Collaborator

All 602 screenshot tests passed for commit 1988a4a vs. master! 💯🎉

aomarks pushed a commit to material-components/material-web that referenced this pull request Jan 8, 2020
…r leading/trailing icons

PR:
  go/mdc-web-pull/5367

Description:
  BREAKING_CHANGE: icons must use `.mdc-text-field__icon--leading` or `.mdc-text-field__icon--trailing` classes. `mdc-text-field-icon-color()` mixin has been split into `mdc-text-field-leading-icon-color()` and `mdc-text-field-trailing-icon-color()`.
Tested:
  https://test.corp.google.com/ui#id=OCL:287554248:BASE:288701267:1578500687772:eaf3ab49
COPYBARA_INTEGRATE_REVIEW=material-components/material-components-web#5367 from material-components:fix/textfield/leading-trailing-icon-classes 3bf0ec97cba823052241450b65ae1edb3af18963
PiperOrigin-RevId: 288741151
@mdc-web-bot
Copy link
Collaborator

All 602 screenshot tests passed for commit a3c5534 vs. master! 💯🎉

@mdc-web-bot
Copy link
Collaborator

All 602 screenshot tests passed for commit e761a87 vs. master! 💯🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants