@solexllc/usx 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/package.json +45 -0
- package/src/_utilities.scss +146 -0
- package/src/components/_accordion.scss +110 -0
- package/src/components/_alert.scss +156 -0
- package/src/components/_attribution.scss +40 -0
- package/src/components/_avatar-group.scss +50 -0
- package/src/components/_avatar.scss +63 -0
- package/src/components/_banner.scss +30 -0
- package/src/components/_block.scss +105 -0
- package/src/components/_branding.scss +89 -0
- package/src/components/_breadcrumb.scss +35 -0
- package/src/components/_button-group.scss +50 -0
- package/src/components/_button.scss +250 -0
- package/src/components/_calendar-date.scss +50 -0
- package/src/components/_carousel.scss +142 -0
- package/src/components/_character-count.scss +12 -0
- package/src/components/_checkbox.scss +68 -0
- package/src/components/_clickable.scss +81 -0
- package/src/components/_code.scss +76 -0
- package/src/components/_collection.scss +27 -0
- package/src/components/_combobox.scss +59 -0
- package/src/components/_copy-to-clipboard.scss +46 -0
- package/src/components/_date-picker.scss +58 -0
- package/src/components/_eyebrow.scss +10 -0
- package/src/components/_file-input.scss +254 -0
- package/src/components/_focus.scss +24 -0
- package/src/components/_footer.scss +185 -0
- package/src/components/_form-group.scss +32 -0
- package/src/components/_header.scss +441 -0
- package/src/components/_hero.scss +149 -0
- package/src/components/_icon-list.scss +23 -0
- package/src/components/_icon.scss +18 -0
- package/src/components/_image.scss +80 -0
- package/src/components/_in-page-nav.scss +74 -0
- package/src/components/_indicator.scss +73 -0
- package/src/components/_input.scss +135 -0
- package/src/components/_language-selector.scss +26 -0
- package/src/components/_layout.scss +115 -0
- package/src/components/_link.scss +63 -0
- package/src/components/_list.scss +4 -0
- package/src/components/_misc-banner.scss +143 -0
- package/src/components/_modal.scss +47 -0
- package/src/components/_page.scss +28 -0
- package/src/components/_pagination.scss +202 -0
- package/src/components/_process-list.scss +35 -0
- package/src/components/_prose.scss +1 -0
- package/src/components/_radio-buttons.scss +66 -0
- package/src/components/_range-slider.scss +117 -0
- package/src/components/_required.scss +7 -0
- package/src/components/_search.scss +10 -0
- package/src/components/_section.scss +26 -0
- package/src/components/_select.scss +112 -0
- package/src/components/_sidenav.scss +74 -0
- package/src/components/_site-alert.scss +75 -0
- package/src/components/_spinner.scss +25 -0
- package/src/components/_status.scss +46 -0
- package/src/components/_step-indicator.scss +130 -0
- package/src/components/_summary-box.scss +42 -0
- package/src/components/_swap.scss +151 -0
- package/src/components/_switch.scss +108 -0
- package/src/components/_table.scss +330 -0
- package/src/components/_tag-group.scss +9 -0
- package/src/components/_tag.scss +47 -0
- package/src/components/_task-list.scss +75 -0
- package/src/components/_text-area.scss +87 -0
- package/src/components/_theme-picker.scss +60 -0
- package/src/components/_time-picker.scss +1 -0
- package/src/components/_toggle.scss +34 -0
- package/src/components/_tooltip.scss +73 -0
- package/src/components/_typography.scss +145 -0
- package/src/icons/spinner.svg +14 -0
- package/src/img/usx-icons.json +5 -0
- package/src/img/usx-sprite.svg +24 -0
- package/src/index.scss +67 -0
- package/src/themed.scss +11 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@use 'pkg:@solexllc/usx-theme/variables' as *;
|
|
2
|
+
|
|
3
|
+
// Global focus-ring override: USWDS hardcodes `outline: .25rem solid #2491ff`
|
|
4
|
+
// directly on these native/interactive selectors, so re-declaring the same
|
|
5
|
+
// rule here (guarded by $usx-color-focus) is the only way to theme it.
|
|
6
|
+
@if $usx-color-focus {
|
|
7
|
+
button:not([disabled]):focus,
|
|
8
|
+
input:not([disabled]):focus,
|
|
9
|
+
select:not([disabled]):focus,
|
|
10
|
+
textarea:not([disabled]):focus,
|
|
11
|
+
.usa-footer__return-to-top a:focus,
|
|
12
|
+
[contentEditable="true"]:focus,
|
|
13
|
+
[href]:focus, [tabindex]:focus,
|
|
14
|
+
iframe:focus {
|
|
15
|
+
outline: .25rem solid $usx-color-focus;
|
|
16
|
+
outline-offset: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.usa-checkbox__input:focus + [class*="__label"]::before,
|
|
20
|
+
.usa-radio__input:focus + [class*="__label"]::before {
|
|
21
|
+
outline: .25rem solid $usx-color-focus;
|
|
22
|
+
outline-offset: 0.25rem;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
@use 'pkg:@solexllc/usx-theme/variables' as *;
|
|
2
|
+
|
|
3
|
+
/* stylelint-disable selector-class-pattern, no-descending-specificity -- Public USX classes use BEM naming; intentional cascade order. */
|
|
4
|
+
.usx-footer {
|
|
5
|
+
@if $usx-footer-bg {
|
|
6
|
+
background-color: $usx-footer-bg;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@if $usx-footer-border-top {
|
|
10
|
+
border-top: $usx-footer-border-top;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@if $usx-footer-text {
|
|
14
|
+
color: $usx-footer-text;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// ── Nav columns (big footer) ──────────────────────────────────────────────
|
|
18
|
+
&__nav-column {
|
|
19
|
+
.usa-footer__primary-link {
|
|
20
|
+
@if $usx-footer-heading-text {
|
|
21
|
+
color: $usx-footer-heading-text;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.usa-footer__primary-link--button {
|
|
25
|
+
@if $usx-footer-bg {
|
|
26
|
+
background-color: $usx-footer-bg;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.usa-footer__secondary-link a {
|
|
32
|
+
@if $usx-footer-secondary-link-text {
|
|
33
|
+
color: $usx-footer-secondary-link-text;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
@if $usx-footer-secondary-link-text-hover {
|
|
38
|
+
color: $usx-footer-secondary-link-text-hover;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ── Sign-up form ─────────────────────────────────────────────────────────
|
|
45
|
+
&__sign-up {
|
|
46
|
+
.usa-sign-up__heading {
|
|
47
|
+
@if $usx-footer-heading-text {
|
|
48
|
+
color: $usx-footer-heading-text;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.usa-button {
|
|
53
|
+
@if $usx-footer-sign-up-button-bg {
|
|
54
|
+
background-color: $usx-footer-sign-up-button-bg;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ── Logo ─────────────────────────────────────────────────────────────────
|
|
60
|
+
&__logo {
|
|
61
|
+
.usa-footer__logo-heading,
|
|
62
|
+
a.usa-footer__logo-heading {
|
|
63
|
+
@if $usx-footer-heading-secondary-text {
|
|
64
|
+
color: $usx-footer-heading-secondary-text;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ── Social links ─────────────────────────────────────────────────────────
|
|
72
|
+
.usa-social-link {
|
|
73
|
+
@if $usx-footer-link-text {
|
|
74
|
+
color: $usx-footer-link-text;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@if $usx-footer-social-radius {
|
|
78
|
+
border-radius: $usx-footer-social-radius;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:hover {
|
|
82
|
+
@if $usx-footer-social-bg-hover {
|
|
83
|
+
background-color: $usx-footer-social-bg-hover;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@if $usx-footer-social-hover-border {
|
|
87
|
+
border: $usx-footer-social-hover-border;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@if $usx-footer-social-hover-outline {
|
|
91
|
+
outline: $usx-footer-social-hover-outline;
|
|
92
|
+
outline-offset: -2px;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.usa-social-link__icon {
|
|
97
|
+
@if $usx-footer-social-icon-filter {
|
|
98
|
+
filter: $usx-footer-social-icon-filter;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ── Contact / address ─────────────────────────────────────────────────────
|
|
104
|
+
&__contact {
|
|
105
|
+
&-info {
|
|
106
|
+
justify-content: end;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.usa-footer__contact-heading {
|
|
110
|
+
@if $usx-footer-heading-secondary-text {
|
|
111
|
+
color: $usx-footer-heading-secondary-text;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
a {
|
|
116
|
+
@if $usx-footer-link-text {
|
|
117
|
+
color: $usx-footer-link-text;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
@if $usx-footer-link-text-hover {
|
|
122
|
+
color: $usx-footer-link-text-hover;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ── Secondary section background ─────────────────────────────────────────
|
|
129
|
+
.usa-footer__secondary-section {
|
|
130
|
+
background-color: unset;
|
|
131
|
+
|
|
132
|
+
@if $usx-footer-secondary-section-border-top {
|
|
133
|
+
border-top: $usx-footer-secondary-section-border-top;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.usa-footer__primary-section {
|
|
138
|
+
@if $usx-footer-primary-bg {
|
|
139
|
+
background-color: $usx-footer-primary-bg;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@if $usx-footer-primary-section-border-top {
|
|
143
|
+
border-top: $usx-footer-primary-section-border-top;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ── Primary-section nav links ────────────────────────────────────────────
|
|
148
|
+
.usa-footer__nav {
|
|
149
|
+
a.usa-footer__primary-link {
|
|
150
|
+
@if $usx-footer-link-text {
|
|
151
|
+
color: $usx-footer-link-text;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&:hover {
|
|
155
|
+
@if $usx-footer-link-text-hover {
|
|
156
|
+
color: $usx-footer-link-text-hover;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
// ── Return to top ────────────────────────────────────────────────────────
|
|
166
|
+
.usx-link.usx-footer__return-to-top {
|
|
167
|
+
display: flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
width: max-content;
|
|
170
|
+
gap: 0.2rem;
|
|
171
|
+
|
|
172
|
+
@if $usx-footer-link-text {
|
|
173
|
+
color: $usx-footer-link-text !important;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&:visited {
|
|
177
|
+
color: unset !important;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&:hover {
|
|
181
|
+
@if $usx-footer-link-text-hover {
|
|
182
|
+
color: $usx-footer-link-text-hover !important;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use 'pkg:@solexllc/usx-theme/variables' as *;
|
|
2
|
+
|
|
3
|
+
/* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
|
|
4
|
+
.usa-label,
|
|
5
|
+
.usa-legend,
|
|
6
|
+
.usa-fieldset > legend {
|
|
7
|
+
@if $usx-text-ink {
|
|
8
|
+
color: $usx-text-ink;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.usa-hint {
|
|
13
|
+
@if $usx-text-subtle {
|
|
14
|
+
color: $usx-text-subtle;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.usx-form-group.usa-form-group--error {
|
|
19
|
+
@if $usx-form-group-error-text {
|
|
20
|
+
border-color: $usx-form-group-error-text;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@if $usx-form-group-error-border-width {
|
|
24
|
+
border-width: $usx-form-group-error-border-width;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.usa-error-message {
|
|
29
|
+
@if $usx-color-error {
|
|
30
|
+
color: $usx-color-error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
@use 'pkg:@solexllc/usx-theme/variables' as *;
|
|
2
|
+
|
|
3
|
+
/* stylelint-disable selector-class-pattern, no-descending-specificity -- Public USX classes use BEM naming; intentional cascade order. */
|
|
4
|
+
.usx-header {
|
|
5
|
+
@if $usx-header-bg {
|
|
6
|
+
background-color: $usx-header-bg;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@if $usx-header-text {
|
|
10
|
+
color: $usx-header-text;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@if $usx-header-border-bottom {
|
|
14
|
+
border-bottom: $usx-header-border-bottom;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@if $usx-header-border-top {
|
|
18
|
+
border-top: $usx-header-border-top;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&::after {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
overflow: unset;
|
|
26
|
+
position: relative;
|
|
27
|
+
|
|
28
|
+
.usa-navbar {
|
|
29
|
+
.usa-menu-btn {
|
|
30
|
+
@if $usx-header-menu-btn-bg {
|
|
31
|
+
background-color: $usx-header-menu-btn-bg;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
@if $usx-header-menu-btn-bg-hover {
|
|
36
|
+
background-color: $usx-header-menu-btn-bg-hover;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:has(> .usx-nav--sticky) {
|
|
45
|
+
overflow: unset;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:has(> .usa-header--extended) {
|
|
49
|
+
// Background is themeable at every width — unlike vendor (which paints no
|
|
50
|
+
// background at desktop and a hardcoded opaque white at mobile), USX lets a
|
|
51
|
+
// theme's configured nav color show through the mobile drawer too, so a
|
|
52
|
+
// dark theme's drawer doesn't revert to an unstyled white panel. Desktop
|
|
53
|
+
// and mobile can be themed independently since the drawer and the nav bar
|
|
54
|
+
// are visually distinct surfaces.
|
|
55
|
+
.usx-nav {
|
|
56
|
+
@media (width < 64em) {
|
|
57
|
+
@if $usx-header-nav-bg-mobile {
|
|
58
|
+
background-color: $usx-header-nav-bg-mobile;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (width >= 64em) {
|
|
63
|
+
@if $usx-header-nav-bg {
|
|
64
|
+
background-color: $usx-header-nav-bg;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// USWDS scopes all of its own .usa-header--extended .usa-nav(__inner) and
|
|
70
|
+
// hover/current-bar rules to this same desktop breakpoint (the nav is an
|
|
71
|
+
// off-canvas mobile drawer below it, styled by vendor's plain .usa-nav
|
|
72
|
+
// mobile rules instead) — mirror that scoping here, or this desktop-only
|
|
73
|
+
// border/spacing leaks into the mobile drawer (extra 2rem padding on top
|
|
74
|
+
// of the drawer's own).
|
|
75
|
+
@media (width >= 64em) {
|
|
76
|
+
.usx-nav {
|
|
77
|
+
@if $usx-header-nav-border-bottom {
|
|
78
|
+
border-bottom: $usx-header-nav-border-bottom;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@if $usx-header-nav-border-top {
|
|
82
|
+
border-top: $usx-header-nav-border-top;
|
|
83
|
+
} @else {
|
|
84
|
+
border-top: 1px solid #dfe1e2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.usa-nav__inner {
|
|
88
|
+
margin-left: auto;
|
|
89
|
+
margin-right: auto;
|
|
90
|
+
max-width: calc($max-layout-width + 4rem);
|
|
91
|
+
padding-left: 2rem;
|
|
92
|
+
padding-right: 2rem;
|
|
93
|
+
position: relative;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// USWDS's own .usa-header--extended .usa-nav__primary-item > .usa-nav__link:hover::after
|
|
97
|
+
// never matches here: our extended layout renders <header> and <nav> as
|
|
98
|
+
// siblings (see Header.tsx), not nested, so that descendant selector has
|
|
99
|
+
// nothing to match against. Reimplemented against our actual DOM shape;
|
|
100
|
+
// extended only differs from the basic default (below) by hover being
|
|
101
|
+
// restricted to top-level items and the bar sitting flush at bottom: 0
|
|
102
|
+
// instead of bottom: -0.25rem.
|
|
103
|
+
.usa-nav__primary-item > .usa-nav__link {
|
|
104
|
+
&:hover,
|
|
105
|
+
&.usa-current {
|
|
106
|
+
position: relative;
|
|
107
|
+
|
|
108
|
+
&::after {
|
|
109
|
+
background-color: $usx-color-primary;
|
|
110
|
+
border-radius: 0;
|
|
111
|
+
content: "";
|
|
112
|
+
display: block;
|
|
113
|
+
position: absolute;
|
|
114
|
+
height: 0.25rem;
|
|
115
|
+
left: 1rem;
|
|
116
|
+
right: 1rem;
|
|
117
|
+
bottom: 0;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// USWDS never shows the bar on a dropdown toggle button, hovered or not.
|
|
122
|
+
&[aria-expanded="true"]::after {
|
|
123
|
+
display: none;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.usa-nav__submenu.usa-megamenu {
|
|
129
|
+
left: 0;
|
|
130
|
+
padding-left: 2rem;
|
|
131
|
+
padding-right: 2rem;
|
|
132
|
+
max-width: calc($max-layout-width + 4rem);
|
|
133
|
+
margin-left: auto;
|
|
134
|
+
margin-right: auto;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.usa-nav.usx-nav {
|
|
140
|
+
float: right;
|
|
141
|
+
|
|
142
|
+
@if $usx-header-nav-link-text-hover {
|
|
143
|
+
// Vendor's dark-background/white-text expanded look is desktop-only (see
|
|
144
|
+
// the aria-expanded background rule further below), so at mobile a hover
|
|
145
|
+
// on an already-open toggle should still track the theme like any other
|
|
146
|
+
// hover; only desktop needs the :not([aria-expanded="true"]) exclusion.
|
|
147
|
+
@media (width < 64em) {
|
|
148
|
+
.usa-nav__primary button:hover {
|
|
149
|
+
color: $usx-header-nav-link-text-hover-mobile;
|
|
150
|
+
|
|
151
|
+
// Vendor hardcodes this hover background at mobile only (and resets
|
|
152
|
+
// it to transparent again at desktop) — match that scoping.
|
|
153
|
+
@if $usx-header-nav-link-bg-hover {
|
|
154
|
+
background-color: $usx-header-nav-link-bg-hover;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&> span::after {
|
|
158
|
+
@if $usx-header-nav-link-text-hover-mobile {
|
|
159
|
+
background-color: $usx-header-nav-link-text-hover-mobile;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@media (width >= 64em) {
|
|
166
|
+
.usa-nav__primary button:not([aria-expanded="true"]):hover {
|
|
167
|
+
color: $usx-header-nav-link-text-hover;
|
|
168
|
+
|
|
169
|
+
&> span::after {
|
|
170
|
+
@if $usx-header-nav-link-text-hover {
|
|
171
|
+
background-color: $usx-header-nav-link-text-hover;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.usa-nav__primary > .usa-nav__primary-item > a:hover {
|
|
178
|
+
@media (width < 64em) {
|
|
179
|
+
color: $usx-header-nav-link-text-hover-mobile;
|
|
180
|
+
|
|
181
|
+
// Vendor hardcodes this hover background at mobile only; desktop
|
|
182
|
+
// links get no hover background at all.
|
|
183
|
+
@if $usx-header-nav-link-bg-hover {
|
|
184
|
+
background-color: $usx-header-nav-link-bg-hover;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@media (width >= 64em) {
|
|
189
|
+
color: $usx-header-nav-link-text-hover;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&::after {
|
|
195
|
+
clear: both;
|
|
196
|
+
content: "";
|
|
197
|
+
display: block;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.usa-nav__close {
|
|
201
|
+
// Only rendered inside the mobile off-canvas drawer, so it tracks the
|
|
202
|
+
// drawer link tokens, not the desktop primary-nav ones.
|
|
203
|
+
// .usa-icon fills via `currentColor`, so tint it with `color`, not
|
|
204
|
+
// `background-color` (which would draw a solid box behind the icon).
|
|
205
|
+
@if $usx-header-nav-link-text-mobile {
|
|
206
|
+
color: $usx-header-nav-link-text-mobile;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&:hover {
|
|
210
|
+
@if $usx-header-nav-link-text-hover-mobile {
|
|
211
|
+
color: $usx-header-nav-link-text-hover-mobile;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@media (width >= 64em) {
|
|
217
|
+
width: 100%;
|
|
218
|
+
float: none;
|
|
219
|
+
|
|
220
|
+
&.usx-nav--sticky:not(.is-visible) {
|
|
221
|
+
display: block;
|
|
222
|
+
z-index: 200;
|
|
223
|
+
position: sticky;
|
|
224
|
+
top: 0;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.usa-nav__inner {
|
|
228
|
+
@if $max-layout-width {
|
|
229
|
+
max-width: calc($max-layout-width + 4rem);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
margin-left: auto;
|
|
233
|
+
margin-right: auto;
|
|
234
|
+
padding-left: 1rem;
|
|
235
|
+
padding-right: 1rem;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.usa-nav__secondary-item + .usa-nav__secondary-item {
|
|
239
|
+
// USWDS's own separator is a border color (#dfe1e2), not the link's
|
|
240
|
+
// text color — $usx-header-secondary-link-text was the wrong token.
|
|
241
|
+
@if $usx-header-nav-border-top {
|
|
242
|
+
border-left: $usx-header-nav-border-top;
|
|
243
|
+
} @else {
|
|
244
|
+
border-left: 1px solid #dfe1e2;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.usa-nav__link {
|
|
250
|
+
// Vendor only swaps the expanded toggle to white text at desktop (paired
|
|
251
|
+
// with the dark expanded background); at mobile it gets no special
|
|
252
|
+
// color at all, so it should still track the theme like every other
|
|
253
|
+
// link — excluding it unconditionally left it on the unthemed browser
|
|
254
|
+
// default whenever the drawer was open.
|
|
255
|
+
@media (width < 64em) {
|
|
256
|
+
&:not(
|
|
257
|
+
.usa-nav__primary button:hover,
|
|
258
|
+
.usa-nav__primary > .usa-nav__primary-item > a:hover,
|
|
259
|
+
.usa-current
|
|
260
|
+
) {
|
|
261
|
+
@if $usx-header-nav-link-text-mobile {
|
|
262
|
+
color: $usx-header-nav-link-text-mobile;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&> span::after {
|
|
266
|
+
@if $usx-header-nav-link-text-mobile {
|
|
267
|
+
background-color: $usx-header-nav-link-text-mobile;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@media (width >= 64em) {
|
|
274
|
+
&:not(
|
|
275
|
+
.usa-nav__primary button[aria-expanded="true"],
|
|
276
|
+
.usa-nav__primary button:hover,
|
|
277
|
+
.usa-nav__primary > .usa-nav__primary-item > a:hover,
|
|
278
|
+
.usa-current
|
|
279
|
+
) {
|
|
280
|
+
@if $usx-header-nav-link-text {
|
|
281
|
+
color: $usx-header-nav-link-text;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
&> span::after {
|
|
285
|
+
@if $usx-header-nav-link-text {
|
|
286
|
+
background-color: $usx-header-nav-link-text;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// Desktop: current text stays the plain link color — only the bottom bar
|
|
293
|
+
// (above) marks state, matching vendor (no .usa-current color override
|
|
294
|
+
// exists in vendor's desktop rules).
|
|
295
|
+
@media (width >= 64em) {
|
|
296
|
+
&.usa-current {
|
|
297
|
+
@if $usx-header-nav-link-text {
|
|
298
|
+
color: $usx-header-nav-link-text;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Mobile: vendor recolors + bolds the current link's text and swaps the
|
|
304
|
+
// bottom bar for a left-side pill indicator — it never reuses the
|
|
305
|
+
// desktop bottom-bar treatment at this width.
|
|
306
|
+
@media (width < 64em) {
|
|
307
|
+
&.usa-current {
|
|
308
|
+
@if $usx-header-nav-link-text-hover-mobile {
|
|
309
|
+
color: $usx-header-nav-link-text-hover-mobile;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
font-weight: 700;
|
|
313
|
+
position: relative;
|
|
314
|
+
|
|
315
|
+
&::after {
|
|
316
|
+
@if $usx-header-nav-link-text-hover-mobile {
|
|
317
|
+
background-color: $usx-header-nav-link-text-hover-mobile;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
border-radius: 99rem;
|
|
321
|
+
content: "";
|
|
322
|
+
display: block;
|
|
323
|
+
position: absolute;
|
|
324
|
+
bottom: 0.25rem;
|
|
325
|
+
top: 0.25rem;
|
|
326
|
+
width: 0.25rem;
|
|
327
|
+
left: 0.25rem;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Current-page/hover indicator bar (basic header default — the extended
|
|
333
|
+
// header block above overrides the hover scope and bottom offset to
|
|
334
|
+
// match USWDS's own basic-vs-extended difference). USWDS only shows this
|
|
335
|
+
// horizontal bottom bar at desktop; at mobile widths it uses a different
|
|
336
|
+
// (left-side) current-page indicator instead, and never shows one on
|
|
337
|
+
// hover at all — showing this bar unconditionally put it on every mobile
|
|
338
|
+
// nav item (including dropdown toggles) on hover, which vendor never does.
|
|
339
|
+
@media (width >= 64em) {
|
|
340
|
+
&:hover,
|
|
341
|
+
&.usa-current {
|
|
342
|
+
position: relative;
|
|
343
|
+
|
|
344
|
+
&::after {
|
|
345
|
+
background-color: $usx-color-primary;
|
|
346
|
+
border-radius: 0;
|
|
347
|
+
content: "";
|
|
348
|
+
display: block;
|
|
349
|
+
position: absolute;
|
|
350
|
+
height: 0.25rem;
|
|
351
|
+
left: 1rem;
|
|
352
|
+
right: 1rem;
|
|
353
|
+
bottom: -0.25rem;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// USWDS never shows the bar on a dropdown toggle button, hovered or not.
|
|
358
|
+
&[aria-expanded="true"]::after {
|
|
359
|
+
display: none;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// Vendor only darkens the open toggle button/submenu at desktop
|
|
364
|
+
// (`.usa-nav__primary button[aria-expanded=true]{background-color:#162e51}`
|
|
365
|
+
// is itself wrapped in `min-width: 64em`); at mobile the drawer's own
|
|
366
|
+
// white background and border-top separators are the only styling, so
|
|
367
|
+
// applying this unconditionally painted a dark box (with the still-gray,
|
|
368
|
+
// unthemed link text from above) over the mobile accordion toggle/panel.
|
|
369
|
+
@media (width >= 64em) {
|
|
370
|
+
&[aria-expanded="true"] {
|
|
371
|
+
@if $usx-header-nav-link-bg {
|
|
372
|
+
background-color: $usx-header-nav-link-bg !important;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
& + .usa-nav__submenu {
|
|
376
|
+
@if $usx-header-nav-submenu-bg {
|
|
377
|
+
background-color: $usx-header-nav-submenu-bg;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
&::before, &::after {
|
|
381
|
+
@if $usx-header-nav-submenu-bg {
|
|
382
|
+
background-color: $usx-header-nav-submenu-bg;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.usa-nav__secondary-item > a {
|
|
391
|
+
@if $usx-header-secondary-link-text {
|
|
392
|
+
color: $usx-header-secondary-link-text;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
&:hover {
|
|
396
|
+
@if $usx-header-secondary-link-text-hover {
|
|
397
|
+
color: $usx-header-secondary-link-text-hover;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
@media (width < 64em) {
|
|
403
|
+
.usa-nav__primary-item, .usa-nav__submenu-item {
|
|
404
|
+
// USWDS's own default is a border color (#dfe1e2), not a text color —
|
|
405
|
+
// $usx-header-nav-link-text was the wrong token here.
|
|
406
|
+
@if $usx-header-nav-border-top {
|
|
407
|
+
border-top: $usx-header-nav-border-top;
|
|
408
|
+
} @else {
|
|
409
|
+
border-top: 1px solid #dfe1e2;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// Submenu links are plain <a> tags with no .usa-nav__link class (see
|
|
414
|
+
// Header.tsx), so the rule above never reaches them — left alone they
|
|
415
|
+
// fall back to vendor's hardcoded gray/blue instead of the active theme.
|
|
416
|
+
.usa-nav__submenu-item > a {
|
|
417
|
+
@if $usx-header-nav-link-text {
|
|
418
|
+
color: $usx-header-nav-link-text;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
&:hover {
|
|
422
|
+
@if $usx-header-nav-link-text-hover {
|
|
423
|
+
color: $usx-header-nav-link-text-hover;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
@if $usx-header-nav-link-bg-hover {
|
|
427
|
+
background-color: $usx-header-nav-link-bg-hover;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
&.usa-current {
|
|
432
|
+
@if $usx-header-nav-link-text-hover {
|
|
433
|
+
color: $usx-header-nav-link-text-hover;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
font-weight: 700;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
}
|