1
- // stylelint-disable selector-max-specificity
2
1
$nav-height : $spacer-3 * 3 !default ; // 48px
3
2
4
3
.UnderlineNav {
@@ -10,6 +9,17 @@ $nav-height: $spacer-3 * 3 !default; // 48px
10
9
box-shadow : inset 0 -1px 0 var (--color-border-muted );
11
10
-webkit-overflow-scrolling : auto ;
12
11
justify-content : space-between ;
12
+
13
+ .Counter {
14
+ margin-left : $spacer-2 ;
15
+ color : var (--color-fg-default );
16
+ background-color : var (--color-neutral-muted );
17
+
18
+ & --primary {
19
+ color : var (--color-fg-on-emphasis );
20
+ background-color : var (--color-neutral-emphasis );
21
+ }
22
+ }
13
23
}
14
24
15
25
.UnderlineNav-body {
@@ -41,65 +51,54 @@ $nav-height: $spacer-3 * 3 !default; // 48px
41
51
color : var (--color-fg-default );
42
52
text-decoration : none ;
43
53
border-bottom-color : var (--color-neutral-muted );
44
- outline-offset : -8 px ;
54
+ outline-offset : -2 px ;
45
55
transition : border-bottom-color 0.12s ease-out ;
56
+ }
46
57
47
- // renders a visibly hidden "copy" of the label in bold, reserving box space for when label becomes bold on selected
48
- [data-content ]::before {
49
- display : block ;
50
- height : 0 ;
51
- font-weight : $font-weight-bold ;
52
- visibility : hidden ;
53
- content : attr (data-content );
54
- }
55
-
56
- // increase touch target area
57
- & ::before {
58
- @include minTouchTarget ($min-height : $nav-height );
59
- }
58
+ // renders a visibly hidden "copy" of the label in bold, reserving box space for when label becomes bold on selected
59
+ [data-content ]::before {
60
+ display : block ;
61
+ height : 0 ;
62
+ font-weight : $font-weight-bold ;
63
+ visibility : hidden ;
64
+ content : attr (data-content );
65
+ }
60
66
61
- // hover state was "sticking" on mobile after click
62
- @media (pointer : fine) {
63
- & :hover {
64
- color : var (--color-fg-default );
65
- text-decoration : none ;
66
- background : var (--color-action-list-item-default-hover-bg );
67
- transition : background 0.12s ease-out ;
68
- }
69
- }
67
+ // increase touch target area
68
+ & ::before {
69
+ @include minTouchTarget ($min-height : $nav-height );
70
+ }
70
71
71
- & .selected ,
72
- & [role = ' tab' ][aria-selected = ' true' ],
73
- & [aria-current ]:not ([aria-current = ' false' ]) {
74
- font-weight : $font-weight-bold ;
72
+ // hover state was "sticking" on mobile after click
73
+ @media (pointer : fine) {
74
+ & :hover {
75
75
color : var (--color-fg-default );
76
- border-bottom-color : var (--color-primer-border-active );
77
- outline-offset : -8px ;
78
-
79
- // current/selected underline
80
- & ::after {
81
- position : absolute ;
82
- right : 50% ;
83
- // 48px total height / 2 (24px) + 1px
84
- bottom : calc (50% - 25px );
85
- width : 100% ;
86
- height : 2px ;
87
- content : ' ' ;
88
- background : var (--color-primer-border-active );
89
- border-radius : $border-radius ;
90
- transform : translate (50% , -50% );
91
- }
76
+ text-decoration : none ;
77
+ background : var (--color-action-list-item-default-hover-bg );
78
+ transition : background 0.12s ease-out ;
92
79
}
93
80
}
94
81
95
- .Counter {
96
- margin-left : $spacer-2 ;
82
+ & .selected ,
83
+ & [role = ' tab' ][aria-selected = ' true' ],
84
+ & [aria-current ]:not ([aria-current = ' false' ]) {
85
+ font-weight : $font-weight-bold ;
97
86
color : var (--color-fg-default );
98
- background-color : var (--color-neutral-muted );
87
+ border-bottom-color : var (--color-primer-border-active );
88
+ outline-offset : -8px ;
99
89
100
- & --primary {
101
- color : var (--color-fg-on-emphasis );
102
- background-color : var (--color-neutral-emphasis );
90
+ // current/selected underline
91
+ & ::after {
92
+ position : absolute ;
93
+ right : 50% ;
94
+ // 48px total height / 2 (24px) + 1px
95
+ bottom : calc (50% - 25px );
96
+ width : 100% ;
97
+ height : 2px ;
98
+ content : ' ' ;
99
+ background : var (--color-primer-border-active );
100
+ border-radius : $border-radius ;
101
+ transform : translate (50% , -50% );
103
102
}
104
103
}
105
104
}
0 commit comments