|
| 1 | +// stylelint-disable selector-max-specificity |
1 | 2 | $nav-height: $spacer-3 * 3 !default; // 48px |
2 | 3 |
|
3 | 4 | .UnderlineNav { |
@@ -43,51 +44,51 @@ $nav-height: $spacer-3 * 3 !default; // 48px |
43 | 44 | outline-offset: -8px; |
44 | 45 | transition: border-bottom-color 0.12s ease-out; |
45 | 46 |
|
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); |
67 | 54 | } |
68 | 55 |
|
69 | | - } |
| 56 | + // increase touch target area |
| 57 | + &::before { |
| 58 | + @include minTouchTarget($min-height: $nav-height); |
| 59 | + } |
70 | 60 |
|
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 | + } |
78 | 70 |
|
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 | + } |
91 | 92 | } |
92 | 93 | } |
93 | 94 |
|
|
0 commit comments