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

refactor(tabs): removed ::after for css-only indicators #1983

Merged
merged 7 commits into from
Jan 19, 2018

Conversation

moog16
Copy link
Contributor

@moog16 moog16 commented Jan 17, 2018

BREAKING CHANGE: all css-only mdc-tabs must have a .mdc-tab-bar__indicator
child element

@codecov-io
Copy link

codecov-io commented Jan 18, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1983   +/-   ##
=======================================
  Coverage   99.43%   99.43%           
=======================================
  Files          84       84           
  Lines        3717     3717           
  Branches      485      485           
=======================================
  Hits         3696     3696           
  Misses         21       21

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 df44329...e45e407. Read the comment docs.

@@ -18,6 +18,16 @@
@import "@material/theme/mixins";
@import "@material/rtl/mixins";

.mdc-tab-bar__indicator,
.mdc-tab__indicator {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if this should be in mdc-tab.scss, or if its ok to be in here.

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be in mdc-tab.scss.

Since you want to share CSS properties across the two classes, you should create a private mixin and re-use it across the two files.

Copy link
Contributor

@lynnmercier lynnmercier left a comment

Choose a reason for hiding this comment

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

Update the README as well! This is a breaking HTML change, so we need to update READMEs

@@ -18,6 +18,16 @@
@import "@material/theme/mixins";
@import "@material/rtl/mixins";

.mdc-tab-bar__indicator,
.mdc-tab__indicator {
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be in mdc-tab.scss.

Since you want to share CSS properties across the two classes, you should create a private mixin and re-use it across the two files.


.mdc-toolbar & {
@include mdc-theme-prop(background-color, text-primary-on-primary);
&.mdc-tab--active,
Copy link
Contributor

Choose a reason for hiding this comment

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

You're breaking BEM here, and being unnecessarily specific, you end up with

 .mdc-tab-bar:not(.mdc-tab-bar-upgraded) .mdc-tab.mdc-tab--active .mdc-tab__indicator {
...

It should be

 .mdc-tab-bar:not(.mdc-tab-bar-upgraded) .mdc-tab--active .mdc-tab__indicator {
...

opacity: .87;
}
}
// stylelint-enable plugin/selector-bem-pattern

// stylelint-disable plugin/selector-bem-pattern
.mdc-tab-bar--icons-with-text:not(.mdc-tab-bar-upgraded) .mdc-tab::after {
top: $mdc-tab-with-icon-and-text-height - 2px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you keep this logic somewhere?

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 is no longer needed since its addressed in the .mdc-tab__indicator { bottom: 2px; } rule

@lynnmercier lynnmercier self-assigned this Jan 19, 2018
Copy link
Contributor

@lynnmercier lynnmercier left a comment

Choose a reason for hiding this comment

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

LGTM (left one last comment)

&--active,
&:not(.mdc-tab--active):active .mdc-tab__indicator {
opacity: .87;
&--active,
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this & syntax, it is confusing

@moog16 moog16 merged commit 5787846 into master Jan 19, 2018
@moog16 moog16 deleted the chore/tabs/css-only-indicator branch January 19, 2018 19:21
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.

3 participants