Skip to content

Commit f84874e

Browse files
committed
fix merge
1 parent a859750 commit f84874e

File tree

2 files changed

+43
-41
lines changed

2 files changed

+43
-41
lines changed

src/navigation/underline-nav.scss

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// stylelint-disable selector-max-specificity
12
$nav-height: $spacer-3 * 3 !default; // 48px
23

34
.UnderlineNav {
@@ -43,51 +44,51 @@ $nav-height: $spacer-3 * 3 !default; // 48px
4344
outline-offset: -8px;
4445
transition: border-bottom-color 0.12s ease-out;
4546

46-
// renders a visibly hidden "copy" of the label in bold, reserving box space for when label becomes bold on selected
47-
[data-content]::before {
48-
display: block;
49-
height: 0;
50-
font-weight: $font-weight-bold;
51-
visibility: hidden;
52-
content: attr(data-content);
53-
}
54-
55-
// increase touch target area
56-
&::before {
57-
@include minTouchTarget($min-height: $nav-height);
58-
}
59-
60-
// hover state was "sticking" on mobile after click
61-
@media (pointer: fine) {
62-
&:hover {
63-
color: var(--color-fg-default);
64-
text-decoration: none;
65-
background: var(--color-action-list-item-default-hover-bg);
66-
transition: background 0.12s ease-out;
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);
6754
}
6855

69-
}
56+
// increase touch target area
57+
&::before {
58+
@include minTouchTarget($min-height: $nav-height);
59+
}
7060

71-
&.selected,
72-
&[role='tab'][aria-selected='true'],
73-
&[aria-current]:not([aria-current='false']) {
74-
font-weight: $font-weight-bold;
75-
color: var(--color-fg-default);
76-
border-bottom-color: var(--color-primer-border-active);
77-
outline-offset: -8px;
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+
}
7870

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%);
71+
&.selected,
72+
&[role='tab'][aria-selected='true'],
73+
&[aria-current]:not([aria-current='false']) {
74+
font-weight: $font-weight-bold;
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+
}
9192
}
9293
}
9394

src/support/mixins/misc.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
outline: 2px solid $outlineColor;
5555
outline-offset: $outlineOffset;
5656
box-shadow: inset 0 0 0 3px var(--color-fg-on-emphasis);
57+
}
5758

5859
// if min-width is undefined, return only min-height
5960
@mixin minTouchTarget($min-height: 32px, $min-width: '') {

0 commit comments

Comments
 (0)