Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
fix(tabs): Fix tab img icon styling. (#5041)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyzhong authored Aug 29, 2019
1 parent 048d4b7 commit d0e6cd1
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions packages/mdc-tab/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
// from the other tah styles. It is recommended that most users use `mdc-tab-core-styles` instead.
@mixin mdc-tab-without-ripple($query: mdc-feature-all()) {
$feat-structure: mdc-feature-create-target($query, structure);
$feat-animation: mdc-feature-create-target($query, animation);

// postcss-bem-linter: define tab

Expand All @@ -57,9 +58,33 @@
@include mdc-tab__content_($query);
}

.mdc-tab__text-label,
.mdc-tab__text-label {
@include mdc-feature-targets($feat-animation) {
transition: 150ms color linear;
}

@include mdc-feature-targets($feat-structure) {
display: inline-block;
// Setting line-height here overrides the line-height from the typography
// mixin above. The line-height needs to be overridden so that the spacing
// between the text label and the icon as well as the text label and the
// bottom of the tab remain the same.
line-height: 1;
z-index: 2;
}
}

.mdc-tab__icon {
@include mdc-tab__content-child_($query);
@include mdc-feature-targets($feat-animation) {
transition: 150ms color linear;
}

@include mdc-feature-targets($feat-structure) {
width: $mdc-tab-icon-size;
height: $mdc-tab-icon-size;
font-size: $mdc-tab-icon-size;
z-index: 2;
}
}

.mdc-tab--stacked {
Expand Down Expand Up @@ -237,25 +262,6 @@
}
}

@mixin mdc-tab__content-child_($query: mdc-feature-all()) {
$feat-animation: mdc-feature-create-target($query, animation);
$feat-structure: mdc-feature-create-target($query, structure);

@include mdc-feature-targets($feat-animation) {
transition: 150ms color linear;
}

@include mdc-feature-targets($feat-structure) {
display: inline-block;
// Setting line-height here overrides the line-height from the typography
// mixin above. The line-height needs to be overridden so that the spacing
// between the text label and the icon as well as the text label and the
// bottom of the tab remain the same.
line-height: 1;
z-index: 2;
}
}

@mixin mdc-tab--stacked_($query: mdc-feature-all()) {
$feat-structure: mdc-feature-create-target($query, structure);

Expand Down

0 comments on commit d0e6cd1

Please sign in to comment.