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

Commit e01bb84

Browse files
author
Matty Goo
authored
fix(tabs): centered and adjusted vertical placement of css-only tab indicator (#2141)
1 parent 0979105 commit e01bb84

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

packages/mdc-tabs/_mixins.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@include mdc-theme-prop(background-color, text-primary-on-light);
33

44
position: absolute;
5-
left: 0;
5+
bottom: 0;
66
height: 2px;
77
visibility: hidden;
88
}

packages/mdc-tabs/tab-bar/mdc-tab-bar.scss

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
@import "./mixins";
2121
@import "../mixins";
2222

23-
.mdc-tab-bar__indicator {
24-
@include mdc-tab-bar-indicator-mixin_;
25-
bottom: 0;
26-
}
27-
2823
// postcss-bem-linter: define tab-bar
2924

3025
@at-root {
@@ -37,14 +32,16 @@
3732
height: 48px;
3833
margin: 0 auto;
3934
text-transform: uppercase;
35+
}
4036

41-
&__indicator {
42-
width: 100%;
37+
.mdc-tab-bar__indicator {
38+
@include mdc-tab-bar-indicator-mixin_;
4339

44-
transform-origin: left top;
45-
transition: mdc-animation-enter(transform, 240ms);
46-
will-change: transform;
47-
}
40+
width: 100%;
41+
left: 0;
42+
transform-origin: left top;
43+
transition: mdc-animation-enter(transform, 240ms);
44+
will-change: transform;
4845
}
4946

5047
.mdc-tab-bar--icons-with-text {

packages/mdc-tabs/tab/mdc-tab.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ $mdc-tab-with-icon-and-text-height: 72px;
9797
.mdc-tab__indicator {
9898
@include mdc-tab-bar-indicator-mixin_;
9999

100-
bottom: 2px;
100+
left: 2px;
101101
width: calc(100% - 4px);
102102
}
103103

0 commit comments

Comments
 (0)