@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.
Files changed (76) hide show
  1. package/README.md +45 -0
  2. package/package.json +45 -0
  3. package/src/_utilities.scss +146 -0
  4. package/src/components/_accordion.scss +110 -0
  5. package/src/components/_alert.scss +156 -0
  6. package/src/components/_attribution.scss +40 -0
  7. package/src/components/_avatar-group.scss +50 -0
  8. package/src/components/_avatar.scss +63 -0
  9. package/src/components/_banner.scss +30 -0
  10. package/src/components/_block.scss +105 -0
  11. package/src/components/_branding.scss +89 -0
  12. package/src/components/_breadcrumb.scss +35 -0
  13. package/src/components/_button-group.scss +50 -0
  14. package/src/components/_button.scss +250 -0
  15. package/src/components/_calendar-date.scss +50 -0
  16. package/src/components/_carousel.scss +142 -0
  17. package/src/components/_character-count.scss +12 -0
  18. package/src/components/_checkbox.scss +68 -0
  19. package/src/components/_clickable.scss +81 -0
  20. package/src/components/_code.scss +76 -0
  21. package/src/components/_collection.scss +27 -0
  22. package/src/components/_combobox.scss +59 -0
  23. package/src/components/_copy-to-clipboard.scss +46 -0
  24. package/src/components/_date-picker.scss +58 -0
  25. package/src/components/_eyebrow.scss +10 -0
  26. package/src/components/_file-input.scss +254 -0
  27. package/src/components/_focus.scss +24 -0
  28. package/src/components/_footer.scss +185 -0
  29. package/src/components/_form-group.scss +32 -0
  30. package/src/components/_header.scss +441 -0
  31. package/src/components/_hero.scss +149 -0
  32. package/src/components/_icon-list.scss +23 -0
  33. package/src/components/_icon.scss +18 -0
  34. package/src/components/_image.scss +80 -0
  35. package/src/components/_in-page-nav.scss +74 -0
  36. package/src/components/_indicator.scss +73 -0
  37. package/src/components/_input.scss +135 -0
  38. package/src/components/_language-selector.scss +26 -0
  39. package/src/components/_layout.scss +115 -0
  40. package/src/components/_link.scss +63 -0
  41. package/src/components/_list.scss +4 -0
  42. package/src/components/_misc-banner.scss +143 -0
  43. package/src/components/_modal.scss +47 -0
  44. package/src/components/_page.scss +28 -0
  45. package/src/components/_pagination.scss +202 -0
  46. package/src/components/_process-list.scss +35 -0
  47. package/src/components/_prose.scss +1 -0
  48. package/src/components/_radio-buttons.scss +66 -0
  49. package/src/components/_range-slider.scss +117 -0
  50. package/src/components/_required.scss +7 -0
  51. package/src/components/_search.scss +10 -0
  52. package/src/components/_section.scss +26 -0
  53. package/src/components/_select.scss +112 -0
  54. package/src/components/_sidenav.scss +74 -0
  55. package/src/components/_site-alert.scss +75 -0
  56. package/src/components/_spinner.scss +25 -0
  57. package/src/components/_status.scss +46 -0
  58. package/src/components/_step-indicator.scss +130 -0
  59. package/src/components/_summary-box.scss +42 -0
  60. package/src/components/_swap.scss +151 -0
  61. package/src/components/_switch.scss +108 -0
  62. package/src/components/_table.scss +330 -0
  63. package/src/components/_tag-group.scss +9 -0
  64. package/src/components/_tag.scss +47 -0
  65. package/src/components/_task-list.scss +75 -0
  66. package/src/components/_text-area.scss +87 -0
  67. package/src/components/_theme-picker.scss +60 -0
  68. package/src/components/_time-picker.scss +1 -0
  69. package/src/components/_toggle.scss +34 -0
  70. package/src/components/_tooltip.scss +73 -0
  71. package/src/components/_typography.scss +145 -0
  72. package/src/icons/spinner.svg +14 -0
  73. package/src/img/usx-icons.json +5 -0
  74. package/src/img/usx-sprite.svg +24 -0
  75. package/src/index.scss +67 -0
  76. package/src/themed.scss +11 -0
@@ -0,0 +1,63 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern, selector-not-notation, no-descending-specificity -- Public USX classes use BEM naming; preserve original :not() specificity and cascade order. */
4
+ .usx-link,
5
+ .usx-prose a {
6
+ display: inline-flex;
7
+ align-items: center;
8
+ width: max-content;
9
+ gap: 0.25rem;
10
+
11
+ &:not([class^="text-"]):not([class*=" text-"]) {
12
+ @if $usx-link-text {
13
+ color: $usx-link-text;
14
+ }
15
+
16
+ &:hover {
17
+ @if $usx-link-text-hover {
18
+ color: $usx-link-text-hover;
19
+ }
20
+ }
21
+
22
+ &:active {
23
+ @if $usx-link-text-active {
24
+ color: $usx-link-text-active;
25
+ }
26
+ }
27
+ }
28
+
29
+ &:not(.usx-no-visited) {
30
+ &:visited,
31
+ &.usx-link--visited {
32
+ @if $usx-link-text-visited {
33
+ color: $usx-link-text-visited;
34
+ }
35
+ }
36
+ }
37
+
38
+ &:focus {
39
+ @if $usx-input-focus-outline {
40
+ color: $usx-input-focus-outline;
41
+ }
42
+ }
43
+ }
44
+
45
+ // On a dark background, USWDS swaps link/visited color to a light neutral
46
+ // (matching the surrounding light text) instead of the blue/purple defaults.
47
+ .usa-dark-background .usx-link,
48
+ .usa-dark-background .usx-prose a {
49
+ &:not([class^="text-"]):not([class*=" text-"]) {
50
+ @if $usx-link-text-dark {
51
+ color: $usx-link-text-dark;
52
+ }
53
+ }
54
+
55
+ &:not(.usx-no-visited) {
56
+ &:visited,
57
+ &.usx-link--visited {
58
+ @if $usx-link-text-visited-dark {
59
+ color: $usx-link-text-visited-dark;
60
+ }
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,4 @@
1
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
2
+ .usx-list {
3
+ display: block;
4
+ }
@@ -0,0 +1,143 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ /* stylelint-disable no-descending-specificity -- Dropdown button rules intentionally follow the focus-state override. */
5
+ .usx-misc-banner {
6
+ display: block;
7
+ position: relative;
8
+
9
+ .usx-misc-banner__content {
10
+ display: flex;
11
+ align-items: center;
12
+ margin-top: 0;
13
+ margin-bottom: 0;
14
+ font-size: $usx-misc-banner-font-size;
15
+ color: #fff;
16
+ background-color: inherit;
17
+ padding-top: .75rem;
18
+ padding-bottom: .75rem;
19
+ line-height: 1.15;
20
+
21
+ .usx-misc-banner__badge {
22
+ background-color: white;
23
+ font-size: $usx-misc-banner-font-size;
24
+ font-weight: $usx-font-weight-bold;
25
+ text-transform: uppercase;
26
+ padding: 6px 11px;
27
+ border-radius: $usx-misc-banner-badge-radius;
28
+ margin-right: 1.25rem;
29
+ }
30
+
31
+ .usx-misc-banner__text {
32
+ margin: 0;
33
+ margin-right: .75rem;
34
+ max-width: 610px;
35
+ }
36
+
37
+ .usx-misc-banner__link {
38
+ display: none;
39
+
40
+ &:visited {
41
+ color: #fff;
42
+ }
43
+
44
+ @media (width >= 64em) {
45
+ display: inline-block;
46
+ color: #fff;
47
+ }
48
+ }
49
+
50
+ .usx-misc-banner__return-text {
51
+ margin: 0;
52
+ position: relative;
53
+ padding-left: 2rem;
54
+ display: none;
55
+ margin-left: auto;
56
+
57
+ @media (width >= 64em) {
58
+ display: inline-block;
59
+ }
60
+ }
61
+
62
+ .usx-misc-banner__dropdown {
63
+ display: inline-block;
64
+ margin: 0 0 0 auto;
65
+ background-color: inherit;
66
+
67
+ @media (width >= 64em) {
68
+ display: none;
69
+ }
70
+
71
+ .usx-misc-banner__dropdown-toggle {
72
+ position: absolute;
73
+ opacity: 0;
74
+ pointer-events: none;
75
+ }
76
+
77
+ .usx-misc-banner__dropdown-toggle:focus + .usx-misc-banner__dropdown-button {
78
+ outline: 0.25rem solid #9bdaf1;
79
+
80
+ @if $usx-misc-banner-focus {
81
+ outline-color: $usx-misc-banner-focus;
82
+ }
83
+ }
84
+
85
+ .usx-misc-banner__dropdown-button {
86
+ height: 3em;
87
+ width: 3em;
88
+ background: none;
89
+ border: none;
90
+ display: flex;
91
+ padding: 0;
92
+ margin: -.5rem;
93
+ margin-right: -1rem;
94
+ align-items: center;
95
+ justify-content: center;
96
+ cursor: pointer;
97
+ user-select: none;
98
+
99
+ svg {
100
+ transition: transform 0.2s ease;
101
+ }
102
+ }
103
+
104
+ .usx-misc-banner__dropdown-toggle:checked + .usx-misc-banner__dropdown-button > svg {
105
+ transform: rotate(180deg);
106
+ }
107
+
108
+ .usx-misc-banner__dropdown-content {
109
+ display: none;
110
+ position: absolute;
111
+ z-index: 400;
112
+ background-color: inherit;
113
+ top: 100%;
114
+ right: 0;
115
+
116
+ .usx-misc-banner__link {
117
+ display: inline-block;
118
+ color: #fff;
119
+ }
120
+
121
+ ul {
122
+ line-height: 1.6;
123
+ margin: 0;
124
+ padding: .75rem 2rem .75rem 1.25rem;
125
+ list-style-type: none;
126
+ width: 20rem;
127
+
128
+ li {
129
+ margin-bottom: 0.75rem;
130
+
131
+ &:last-child {
132
+ margin-bottom: .25rem;
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ .usx-misc-banner__dropdown-toggle:checked ~ .usx-misc-banner__dropdown-content {
139
+ display: block;
140
+ }
141
+ }
142
+ }
143
+ }
@@ -0,0 +1,47 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usx-modal {
5
+ @if $usx-modal-bg {
6
+ background: $usx-modal-bg;
7
+ }
8
+
9
+ @if $usx-modal-text {
10
+ color: $usx-modal-text;
11
+ }
12
+
13
+ .usa-modal__close {
14
+ @if $usx-modal-close-text {
15
+ color: $usx-modal-close-text;
16
+ }
17
+
18
+ &:hover,
19
+ &:active {
20
+ @if $usx-modal-close-text-hover {
21
+ color: $usx-modal-close-text-hover;
22
+ }
23
+ }
24
+ }
25
+
26
+ &.usx-modal--lg-collapsed {
27
+ max-width: 55rem;
28
+ width: 100%;
29
+
30
+ .usa-modal__heading {
31
+ font-size: $usx-modal-heading-font-size;
32
+ margin-top: 0;
33
+ line-height: 1.34em;
34
+ }
35
+
36
+ .usa-modal__main {
37
+ padding: 2rem;
38
+ padding-top: 0;
39
+ width: 100%;
40
+ max-width: 100%;
41
+
42
+ .usa-prose {
43
+ min-height: 3rem;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,28 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usx-page {
5
+ margin-top: 2rem;
6
+ margin-bottom: 4rem;
7
+
8
+ @if $usx-page-bg {
9
+ background-color: $usx-page-bg;
10
+ }
11
+
12
+ @if $usx-page-text {
13
+ color: $usx-page-text;
14
+ }
15
+
16
+ .usx-page__title {
17
+ margin-top: 0;
18
+ margin-bottom: 1.5rem;
19
+ }
20
+
21
+ .usx-page__content {
22
+ display: block;
23
+
24
+ p {
25
+ max-width: 64ex;
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,202 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ // ── Container layout ────────────────────────────────────────────────────
4
+ .usx-pagination__container {
5
+ padding-top: .75rem;
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: start;
9
+ gap: 1rem;
10
+
11
+ @if $usx-color-base {
12
+ border-top: 1px solid $usx-color-base;
13
+ }
14
+
15
+ @media (width >=#{$breakpoint-desktop}) {
16
+ flex-flow: row wrap;
17
+ justify-content: space-between;
18
+ align-items: center;
19
+ }
20
+ }
21
+
22
+ .usx-pagination__container-start {
23
+ place-content: center center;
24
+ align-items: center;
25
+
26
+ @media (width >=#{$breakpoint-desktop}) {
27
+ flex: 1 1 auto;
28
+ }
29
+ }
30
+
31
+ .usx-pagination__container-end {
32
+ display: flex;
33
+ flex-direction: column;
34
+ place-content: start start;
35
+ align-items: start;
36
+ gap: 1rem;
37
+
38
+ @media (width >=#{$breakpoint-tablet}) {
39
+ width: 100%;
40
+ flex-flow: row wrap;
41
+ align-items: center;
42
+ justify-content: space-between;
43
+ }
44
+
45
+ @media (width >=#{$breakpoint-desktop}) {
46
+ width: auto;
47
+ flex: 0 1 auto;
48
+ flex-flow: row wrap;
49
+ align-items: center;
50
+ justify-content: end;
51
+ }
52
+ }
53
+
54
+ // ── Navigation ──────────────────────────────────────────────────────────
55
+ .usx-pagination__nav {
56
+ margin: 0;
57
+
58
+ // Real USWDS hardcodes the `.usa-pagination` nav to a static white bg /
59
+ // #1b1b1b text — floats as an opaque box over a themed page background.
60
+ @if $usx-pagination-bg {
61
+ background-color: $usx-pagination-bg;
62
+ }
63
+
64
+ @if $usx-pagination-text {
65
+ color: $usx-pagination-text;
66
+ }
67
+
68
+ .usa-pagination__list {
69
+ gap: 0.5rem;
70
+
71
+ .usa-pagination__item {
72
+ margin: 0;
73
+ }
74
+ }
75
+
76
+ // Real USWDS's compiled CSS hardcodes pagination link/button text and
77
+ // the current-page underline to literal `color("primary")`/`primary-
78
+ // vivid` — nav/wayfinding element, should track the theme. Scoped to
79
+ // `.usx-pagination` so it doesn't affect unrelated `.usa-current` usages
80
+ // elsewhere (header nav, in-page-nav, sidenav).
81
+ .usa-pagination__link {
82
+ @if $usx-pagination-link-text {
83
+ color: $usx-pagination-link-text;
84
+ }
85
+
86
+ &:visited {
87
+ @if $usx-pagination-link-text {
88
+ color: $usx-pagination-link-text;
89
+ }
90
+ }
91
+
92
+ &:hover {
93
+ @if $usx-pagination-link-text-hover {
94
+ color: $usx-pagination-link-text-hover;
95
+ }
96
+ }
97
+ }
98
+
99
+ .usa-pagination__button {
100
+ @if $usx-pagination-link-text {
101
+ color: $usx-pagination-link-text;
102
+ }
103
+
104
+ &:not(.usa-current) {
105
+ @if $usx-pagination-button-border {
106
+ border-color: $usx-pagination-button-border;
107
+ }
108
+ }
109
+
110
+ &:hover {
111
+ @if $usx-pagination-link-text-hover {
112
+ color: $usx-pagination-link-text-hover;
113
+ border-color: $usx-pagination-link-text-hover;
114
+ }
115
+ }
116
+
117
+ // Real USWDS hardcodes the filled current-page button to a static
118
+ // #1b1b1b bg / #fff text (`.usa-pagination .usa-current`) — higher
119
+ // specificity than the plain-link rule above so it wins instead of
120
+ // inheriting the link color over its own filled background.
121
+ &.usa-current {
122
+ @if $usx-pagination-current-bg {
123
+ background-color: $usx-pagination-current-bg;
124
+ }
125
+
126
+ @if $usx-pagination-current-text {
127
+ color: $usx-pagination-current-text;
128
+ }
129
+
130
+ &:hover,
131
+ &:focus,
132
+ &:active {
133
+ @if $usx-pagination-current-bg {
134
+ background-color: $usx-pagination-current-bg;
135
+ }
136
+
137
+ @if $usx-pagination-current-text {
138
+ color: $usx-pagination-current-text;
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+ .usa-pagination__link--disabled {
145
+ color: $usx-color-base;
146
+ cursor: not-allowed;
147
+ pointer-events: none;
148
+ opacity: 0.4;
149
+ text-decoration: none;
150
+ }
151
+ }
152
+
153
+ // ── Summary ─────────────────────────────────────────────────────────────
154
+ .usx-pagination__summary {
155
+ font-size: $usx-font-size-base;
156
+ color: $usx-text-ink;
157
+ margin: 0;
158
+ }
159
+
160
+ // ── Step Options ────────────────────────────────────────────────────────
161
+ .usx-pagination__step-options {
162
+ display: flex;
163
+ align-items: center;
164
+ gap: 0.5rem;
165
+
166
+ .usx-label {
167
+ font-size: $usx-font-size-base;
168
+ white-space: nowrap;
169
+ color: $usx-text-ink;
170
+ margin: 0;
171
+ }
172
+
173
+ .usx-select {
174
+ // Override USWDS default full-width with compact inline sizing
175
+ width: auto !important;
176
+ max-width: 5rem;
177
+ padding-top: 0.25rem;
178
+ padding-bottom: 0.25rem;
179
+ margin: 0;
180
+ height: auto;
181
+ }
182
+ }
183
+
184
+ .usx-pagination__container-end:has(.usx-pagination__arrows-only) {
185
+ flex-direction: row;
186
+ justify-content: end;
187
+ align-items: center;
188
+
189
+ .usa-pagination__arrow {
190
+ display: flex;
191
+
192
+ .usa-pagination__link {
193
+ padding: .5rem;
194
+ margin: 0;
195
+
196
+ .usa-icon {
197
+ height: 2rem;
198
+ width: 2rem;
199
+ }
200
+ }
201
+ }
202
+ }
@@ -0,0 +1,35 @@
1
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
2
+
3
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
4
+
5
+ // Real USWDS hardcodes heading/counter text to #1b1b1b and the connecting
6
+ // line + circle border to fixed light-blue/gray-cool literals — give them
7
+ // themeable defaults instead.
8
+ .usx-process-list {
9
+ .usa-process-list__heading {
10
+ @if $usx-process-list-heading-text {
11
+ color: $usx-process-list-heading-text;
12
+ }
13
+ }
14
+
15
+ .usa-process-list__item {
16
+ @if $usx-process-list-border {
17
+ border-left-color: $usx-process-list-border;
18
+ }
19
+
20
+ &::before {
21
+ @if $usx-process-list-counter-text {
22
+ color: $usx-process-list-counter-text;
23
+ }
24
+
25
+ @if $usx-process-list-counter-border {
26
+ border-color: $usx-process-list-counter-border;
27
+ }
28
+
29
+ @if $usx-process-list-counter-ring {
30
+ background-color: $usx-process-list-counter-ring;
31
+ box-shadow: 0 0 0 4px $usx-process-list-counter-ring;
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1 @@
1
+ // See typography and link styles for USX prose content.
@@ -0,0 +1,66 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usa-radio__label {
5
+ @if $usx-text-ink {
6
+ color: $usx-text-ink;
7
+ }
8
+ }
9
+
10
+ .usa-radio__input--tile + .usa-radio__label {
11
+ @if $usx-surface-1 {
12
+ background-color: $usx-surface-1;
13
+ }
14
+ }
15
+
16
+ .usa-radio.usx-radio {
17
+ &.usx-radio--small {
18
+ .usa-radio__input + .usa-radio__label::before {
19
+ height: 1.125rem;
20
+ width: 1.125rem;
21
+ }
22
+ }
23
+
24
+ @if $usx-checkable-tile-radius {
25
+ .usa-radio__input--tile + .usa-radio__label {
26
+ border-radius: $usx-checkable-tile-radius;
27
+ }
28
+ }
29
+
30
+ .usa-radio__input--tile + .usa-radio__label {
31
+ @if $usx-checkable-tile-border {
32
+ border-color: $usx-checkable-tile-border;
33
+ }
34
+
35
+ @if $usx-checkable-tile-border-width {
36
+ border-width: $usx-checkable-tile-border-width;
37
+ }
38
+ }
39
+
40
+ .usa-radio__label::before {
41
+ @if $usx-checkable-bg {
42
+ background-color: $usx-checkable-bg;
43
+ }
44
+
45
+ @if $usx-checkable-border {
46
+ box-shadow: 0 0 0 2px $usx-checkable-border;
47
+ }
48
+ }
49
+
50
+ .usa-radio__input:checked:not(:disabled) {
51
+ & + .usa-radio__label {
52
+ @if $usx-color-primary {
53
+ &::before {
54
+ background-color: $usx-color-primary;
55
+ box-shadow: 0 0 0 2px $usx-color-primary, inset 0 0 0 2px #fff;
56
+ }
57
+ }
58
+ }
59
+
60
+ &.usa-radio__input--tile + .usa-radio__label {
61
+ @if $usx-color-primary {
62
+ border-color: $usx-color-primary;
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,117 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Real USWDS classes, not USX BEM. */
4
+
5
+ /* ---------------------------------- */
6
+
7
+ /* Theme Corrections */
8
+
9
+ /* ---------------------------------- */
10
+
11
+ // The shared text-input placeholder (%block-input-general/%block-input-styles)
12
+ // bakes a white background onto every <input>, including this one — but only
13
+ // the track/thumb pseudo-elements below are meant to be visible. Left alone,
14
+ // that white fill shows through as a solid box around the track on any
15
+ // non-white surface (the input's own padding-box is taller than the track).
16
+ .usa-range {
17
+ background-color: transparent;
18
+ }
19
+
20
+ // USWDS bakes the track to a fixed "base-lightest" bg / "base-darker" border
21
+ // regardless of theme.
22
+ //
23
+ // IMPORTANT: each vendor-prefixed pseudo-element below must stay in its own
24
+ // rule (never comma-combined, unlike normal classes elsewhere in this file).
25
+ // A selector list containing a pseudo-element a browser doesn't recognize
26
+ // (e.g. Chrome sees ::-moz-range-track) invalidates the ENTIRE rule, so
27
+ // combining them silently drops the whole override. USWDS's own source
28
+ // (_usa-range.scss) writes them the same way for this exact reason.
29
+ @if $usx-range-slider-track-bg {
30
+ .usa-range::-webkit-slider-runnable-track {
31
+ background-color: $usx-range-slider-track-bg;
32
+ }
33
+
34
+ .usa-range::-moz-range-track {
35
+ background-color: $usx-range-slider-track-bg;
36
+ }
37
+
38
+ .usa-range::-ms-track {
39
+ background-color: $usx-range-slider-track-bg;
40
+ }
41
+ }
42
+
43
+ @if $usx-range-slider-track-border {
44
+ .usa-range::-webkit-slider-runnable-track {
45
+ border-color: $usx-range-slider-track-border;
46
+ }
47
+
48
+ .usa-range::-moz-range-track {
49
+ border-color: $usx-range-slider-track-border;
50
+ }
51
+
52
+ .usa-range::-ms-track {
53
+ border-color: $usx-range-slider-track-border;
54
+ }
55
+ }
56
+
57
+ @if $usx-range-slider-border-width {
58
+ .usa-range::-webkit-slider-runnable-track {
59
+ border-width: $usx-range-slider-border-width;
60
+ }
61
+
62
+ .usa-range::-moz-range-track {
63
+ border-width: $usx-range-slider-border-width;
64
+ }
65
+
66
+ .usa-range::-ms-track {
67
+ border-width: $usx-range-slider-border-width;
68
+ }
69
+ }
70
+
71
+ // USWDS bakes the thumb to the same fixed "base-lightest" bg / "base-darker"
72
+ // outline (drawn as a box-shadow so the thumb stays circular) regardless of
73
+ // theme.
74
+ @if $usx-range-slider-thumb-bg {
75
+ .usa-range::-webkit-slider-thumb {
76
+ background-color: $usx-range-slider-thumb-bg;
77
+ }
78
+
79
+ .usa-range::-moz-range-thumb {
80
+ background-color: $usx-range-slider-thumb-bg;
81
+ }
82
+
83
+ .usa-range::-ms-thumb {
84
+ background-color: $usx-range-slider-thumb-bg;
85
+ }
86
+ }
87
+
88
+ @if $usx-range-slider-thumb-border and $usx-range-slider-border-width {
89
+ .usa-range::-webkit-slider-thumb {
90
+ box-shadow: 0 0 0 $usx-range-slider-border-width $usx-range-slider-thumb-border;
91
+ }
92
+
93
+ .usa-range::-moz-range-thumb {
94
+ box-shadow: 0 0 0 $usx-range-slider-border-width $usx-range-slider-thumb-border;
95
+ }
96
+
97
+ .usa-range::-ms-thumb {
98
+ box-shadow: 0 0 0 $usx-range-slider-border-width $usx-range-slider-thumb-border;
99
+ }
100
+ }
101
+
102
+ // USWDS's own focus mixin bakes the thumb's focus ring to a compile-time
103
+ // Sass setting ($theme-focus-color), not a runtime CSS var — reuse the same
104
+ // focus token the rest of the library themes with instead.
105
+ @if $usx-range-slider-focus and $usx-range-slider-border-width {
106
+ .usa-range:focus::-webkit-slider-thumb {
107
+ box-shadow: 0 0 0 $usx-range-slider-border-width $usx-range-slider-focus;
108
+ }
109
+
110
+ .usa-range:focus::-moz-range-thumb {
111
+ box-shadow: 0 0 0 $usx-range-slider-border-width $usx-range-slider-focus;
112
+ }
113
+
114
+ .usa-range:focus::-ms-thumb {
115
+ box-shadow: 0 0 0 $usx-range-slider-border-width $usx-range-slider-focus;
116
+ }
117
+ }