@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,149 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ // Hero is a USX-only (custom) component with no USWDS baseline, so its
4
+ // default look is baked in here. Each declaration is overridden when the
5
+ // corresponding token is set (via theme hooks or `with (...)`).
6
+
7
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
8
+ .usx-hero {
9
+ position: relative;
10
+ display: flex;
11
+ align-items: center;
12
+ min-height: 30rem;
13
+ background-color: #010610;
14
+ background-size: cover;
15
+ background-position: center;
16
+ background-repeat: no-repeat;
17
+ color: #fff;
18
+
19
+ @if $usx-hero-min-height {
20
+ min-height: $usx-hero-min-height;
21
+ }
22
+
23
+ @if $usx-hero-bg {
24
+ background-color: $usx-hero-bg;
25
+ }
26
+
27
+ @if $usx-hero-text {
28
+ color: $usx-hero-text;
29
+ }
30
+
31
+ &--has-overlay::before {
32
+ content: '';
33
+ position: absolute;
34
+ inset: 0;
35
+ background-color: rgb(0 0 0 / 55%);
36
+ pointer-events: none;
37
+
38
+ @if $usx-hero-overlay-bg {
39
+ background-color: $usx-hero-overlay-bg;
40
+ }
41
+ }
42
+
43
+ &__inner {
44
+ position: relative;
45
+ z-index: 1;
46
+ width: 100%;
47
+ max-width: $max-layout-width;
48
+ margin-inline: auto;
49
+ padding-block: 4rem;
50
+ padding-inline: 1.5rem;
51
+
52
+ @if $usx-hero-padding-block {
53
+ padding-block: $usx-hero-padding-block;
54
+ }
55
+
56
+ @if $usx-hero-padding-inline {
57
+ padding-inline: $usx-hero-padding-inline;
58
+ }
59
+ }
60
+
61
+ &__callout {
62
+ max-width: 40rem;
63
+ padding: 2rem;
64
+ background-color: rgb(0 0 0 / 60%);
65
+
66
+ // Radius follows the app-wide radius-box group (null/square by default,
67
+ // like every other radius-box consumer: image, code, summary-box).
68
+ border-radius: $usx-hero-callout-radius;
69
+
70
+ @if $usx-hero-callout-max-width {
71
+ max-width: $usx-hero-callout-max-width;
72
+ }
73
+
74
+ @if $usx-hero-callout-padding {
75
+ padding: $usx-hero-callout-padding;
76
+ }
77
+
78
+ @if $usx-hero-callout-bg {
79
+ background-color: $usx-hero-callout-bg;
80
+ }
81
+ }
82
+
83
+ &__heading {
84
+ font-family: $usx-font-family-heading;
85
+ font-size: $usx-font-size-h1;
86
+ font-weight: $usx-font-weight-bold;
87
+ line-height: $usx-line-height-heading;
88
+ margin-top: 0;
89
+ margin-bottom: 1rem;
90
+ color: #fff;
91
+
92
+ @if $usx-hero-heading-size {
93
+ font-size: $usx-hero-heading-size;
94
+ }
95
+
96
+ @if $usx-hero-heading-font-weight {
97
+ font-weight: $usx-hero-heading-font-weight;
98
+ }
99
+
100
+ @if $usx-spacing-md {
101
+ margin-bottom: $usx-spacing-md;
102
+ }
103
+
104
+ @if $usx-hero-text {
105
+ color: $usx-hero-text;
106
+ }
107
+
108
+ &--alt {
109
+ display: block;
110
+ font-size: 1.125rem;
111
+ font-weight: $usx-font-weight-regular;
112
+ margin-bottom: 0.25rem;
113
+ color: #66b5ee;
114
+
115
+ @if $usx-hero-alt-size {
116
+ font-size: $usx-hero-alt-size;
117
+ }
118
+
119
+ @if $usx-spacing-xs {
120
+ margin-bottom: $usx-spacing-xs;
121
+ }
122
+
123
+ @if $usx-hero-alt-text {
124
+ color: $usx-hero-alt-text;
125
+ }
126
+ }
127
+ }
128
+
129
+ &__paragraph {
130
+ font-size: 1.125rem;
131
+ line-height: 1.6;
132
+ margin-top: 0;
133
+ margin-bottom: 1.5rem;
134
+ color: #fff;
135
+
136
+ @if $usx-hero-paragraph-size {
137
+ font-size: $usx-hero-paragraph-size;
138
+ }
139
+
140
+ @if $usx-spacing-lg {
141
+ margin-bottom: $usx-spacing-lg;
142
+ }
143
+
144
+ @if $usx-hero-text {
145
+ color: $usx-hero-text;
146
+ }
147
+ }
148
+ }
149
+ /* stylelint-enable selector-class-pattern */
@@ -0,0 +1,23 @@
1
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
2
+
3
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
4
+
5
+ .usx-icon-list {
6
+ .usa-icon-list__item {
7
+ align-items: flex-start;
8
+ }
9
+
10
+ .usa-icon-list__icon {
11
+ flex: 0 0 auto;
12
+
13
+ // Real USWDS only colors the icon via opt-in BEM modifier classes
14
+ // (.usa-icon-list--primary, etc.) — default it to our theme instead.
15
+ @if $usx-icon-list-icon-text {
16
+ color: $usx-icon-list-icon-text;
17
+ }
18
+ }
19
+
20
+ .usa-icon-list__content {
21
+ flex: 1 1 auto;
22
+ }
23
+ }
@@ -0,0 +1,18 @@
1
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
2
+ .usx-icon--size-1 {
3
+ width: .75em;
4
+ height: .75em;
5
+ }
6
+
7
+ .usx-icon--mirror {
8
+ transform: scaleX(-1);
9
+ }
10
+
11
+ .usx-icon--flip {
12
+ transform: scaleY(-1);
13
+
14
+ &.usx-icon--mirror {
15
+ transform: rotate(180deg);
16
+ }
17
+ }
18
+ /* stylelint-enable selector-class-pattern */
@@ -0,0 +1,80 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usx-image {
5
+ display: inline-block;
6
+ margin: 0;
7
+ padding: 0;
8
+ align-items: center;
9
+
10
+ &--rounded img {
11
+ border-radius: $usx-image-radius;
12
+ }
13
+
14
+ &--circular img {
15
+ border-radius: 50%;
16
+ aspect-ratio: 1;
17
+ object-fit: cover;
18
+ }
19
+
20
+ .usx-image--caption {
21
+ margin-top: .5rem;
22
+ font-style: italic;
23
+ contain: inline-size;
24
+ }
25
+ }
26
+ /* stylelint-enable selector-class-pattern */
27
+
28
+ .usx-object-fit-cover,
29
+ .usx-object-fit-contain,
30
+ .usx-object-fit-fill {
31
+ width: 100%;
32
+ height: 100%;
33
+ max-width: 100%;
34
+ max-height: 100%;
35
+ }
36
+
37
+ .usx-object-fit-none,
38
+ .usx-object-fit-scale-down {
39
+ width: auto;
40
+ height: auto;
41
+ max-width: 100%;
42
+ max-height: 100%;
43
+ }
44
+
45
+ .usx-object-fit-cover :is(img, object, video),
46
+ .usx-object-fit-contain :is(img, object, video),
47
+ .usx-object-fit-fill :is(img, object, video) {
48
+ width: 100%;
49
+ height: 100%;
50
+ max-width: 100%;
51
+ max-height: 100%;
52
+ }
53
+
54
+ .usx-object-fit-none :is(img, object, video),
55
+ .usx-object-fit-scale-down :is(img, object, video) {
56
+ width: auto;
57
+ height: auto;
58
+ max-width: 100%;
59
+ max-height: 100%;
60
+ }
61
+
62
+ .usx-object-fit-cover :is(img, object, video) {
63
+ object-fit: cover;
64
+ }
65
+
66
+ .usx-object-fit-contain :is(img, object, video) {
67
+ object-fit: contain;
68
+ }
69
+
70
+ .usx-object-fit-fill :is(img, object, video) {
71
+ object-fit: fill;
72
+ }
73
+
74
+ .usx-object-fit-none :is(img, object, video) {
75
+ object-fit: none;
76
+ }
77
+
78
+ .usx-object-fit-scale-down :is(img, object, video) {
79
+ object-fit: scale-down;
80
+ }
@@ -0,0 +1,74 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Real USWDS classes, not USX BEM. */
4
+
5
+ // Real USWDS resolves the in-page-nav card's background/text/link/current/
6
+ // bar colors from compile-time $theme-in-page-nav-* Sass settings (all
7
+ // "default", i.e. computed against the page background at build time), so
8
+ // none of them follow a runtime theme override on their own. Chain each
9
+ // role below to the shared $usx-in-page-nav-* tokens (see _variables.scss)
10
+ // instead of leaving the compiled defaults frozen.
11
+
12
+ .usa-in-page-nav-container {
13
+ main,
14
+ .usx-in-page-nav__content {
15
+ max-width: 100%;
16
+ }
17
+ }
18
+
19
+ .usa-in-page-nav__nav {
20
+ @if $usx-in-page-nav-bg {
21
+ background-color: $usx-in-page-nav-bg;
22
+ }
23
+
24
+ @if $usx-in-page-nav-text {
25
+ color: $usx-in-page-nav-text;
26
+ }
27
+ }
28
+
29
+ .usa-in-page-nav__heading {
30
+ @if $usx-in-page-nav-text {
31
+ color: $usx-in-page-nav-text;
32
+ }
33
+ }
34
+
35
+ .usa-in-page-nav__list {
36
+ @if $usx-in-page-nav-border {
37
+ border-left-color: $usx-in-page-nav-border;
38
+ }
39
+
40
+ a:not(.usa-button) {
41
+ &:not(.usa-current) {
42
+ @if $usx-in-page-nav-link-text {
43
+ color: $usx-in-page-nav-link-text;
44
+ }
45
+
46
+ &:hover {
47
+ @if $usx-in-page-nav-link-text-hover {
48
+ color: $usx-in-page-nav-link-text-hover;
49
+ }
50
+ }
51
+
52
+ // Matches real USWDS's own compiled selector
53
+ // (a:not(.usa-button):not(.usa-current):visited) class-for-class so
54
+ // this wins the cascade instead of losing to it on specificity.
55
+ &:visited {
56
+ @if $usx-in-page-nav-link-text {
57
+ color: $usx-in-page-nav-link-text;
58
+ }
59
+ }
60
+ }
61
+
62
+ &.usa-current {
63
+ @if $usx-in-page-nav-current-text {
64
+ color: $usx-in-page-nav-current-text;
65
+ }
66
+
67
+ &::after {
68
+ @if $usx-in-page-nav-bar {
69
+ background-color: $usx-in-page-nav-bar;
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,73 @@
1
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
2
+ .usx-indicator {
3
+ position: relative;
4
+ display: inline-flex;
5
+ width: max-content;
6
+
7
+ :where(.usx-indicator-item) {
8
+ z-index: 1;
9
+ position: absolute;
10
+ white-space: nowrap;
11
+ inset: var(--indicator-t, 0) var(--indicator-e, 0) var(--indicator-b, 0) var(--indicator-s, auto);
12
+ translate: var(--indicator-x, 50%) var(--indicator-y, -50%);
13
+ }
14
+
15
+ .usx-indicator-item {
16
+ position: absolute !important;
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: center;
20
+ }
21
+ }
22
+
23
+ .usx-indicator-start {
24
+ --indicator-s: 0;
25
+ --indicator-x: -50%;
26
+ --indicator-e: auto;
27
+
28
+ [dir='rtl'] & {
29
+ --indicator-s: auto;
30
+ --indicator-e: 0;
31
+ --indicator-x: 50%;
32
+ }
33
+ }
34
+
35
+ .usx-indicator-center {
36
+ --indicator-s: 50%;
37
+ --indicator-e: 50%;
38
+ --indicator-x: -50%;
39
+
40
+ [dir='rtl'] & {
41
+ --indicator-x: 50%;
42
+ }
43
+ }
44
+
45
+ .usx-indicator-end {
46
+ --indicator-s: auto;
47
+ --indicator-e: 0;
48
+ --indicator-x: 50%;
49
+
50
+ [dir='rtl'] & {
51
+ --indicator-s: 0;
52
+ --indicator-e: auto;
53
+ --indicator-x: -50%;
54
+ }
55
+ }
56
+
57
+ .usx-indicator-bottom {
58
+ --indicator-t: auto;
59
+ --indicator-b: 0;
60
+ --indicator-y: 50%;
61
+ }
62
+
63
+ .usx-indicator-middle {
64
+ --indicator-t: 50%;
65
+ --indicator-b: 50%;
66
+ --indicator-y: -50%;
67
+ }
68
+
69
+ .usx-indicator-top {
70
+ --indicator-t: 0;
71
+ --indicator-b: auto;
72
+ --indicator-y: -50%;
73
+ }
@@ -0,0 +1,135 @@
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-duplicate-selectors -- Base/state/error/success/focus split into intentional blocks. */
5
+ /* stylelint-disable no-descending-specificity -- Focus enhancements intentionally follow state rules. */
6
+
7
+ /* ---------------------------------- */
8
+
9
+ /* Base Enhancements */
10
+
11
+ /* ---------------------------------- */
12
+
13
+ .usa-input.usx-input, .usa-select.usx-select, .usa-combo-box__input {
14
+ @if $usx-input-radius {
15
+ border-radius: $usx-input-radius;
16
+ }
17
+
18
+ @if $usx-input-padding {
19
+ padding: $usx-input-padding;
20
+ }
21
+ }
22
+
23
+ /* ---------------------------------- */
24
+
25
+ /* State Enhancements */
26
+
27
+ /* ---------------------------------- */
28
+
29
+ .usa-input.usx-input, .usa-select.usx-select {
30
+ &:not(.usa-input--error):not(.usa-input--success) {
31
+ &:not(:disabled) {
32
+ @if $usx-input-bg {
33
+ background-color: $usx-input-bg;
34
+ }
35
+
36
+ @if $usx-input-text {
37
+ color: $usx-input-text;
38
+ }
39
+
40
+ @if $usx-input-border {
41
+ border-color: $usx-input-border;
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ .usa-input.usx-input, .usa-select.usx-select {
48
+ &.usa-input--error {
49
+ @if $usx-input-error-border-width {
50
+ border-width: $usx-input-error-border-width;
51
+ }
52
+
53
+ @if $usx-input-error-border {
54
+ border-color: $usx-input-error-border;
55
+ }
56
+
57
+ @if $usx-input-error-border-style {
58
+ border-style: $usx-input-error-border-style;
59
+ }
60
+
61
+ @if $usx-input-error-padding-top {
62
+ padding-top: $usx-input-error-padding-top;
63
+ }
64
+
65
+ @if $usx-input-error-padding-bottom {
66
+ padding-bottom: $usx-input-error-padding-bottom;
67
+ }
68
+ }
69
+ }
70
+
71
+ .usa-input.usx-input, .usa-select.usx-select {
72
+ // Error can be toggled dynamically (e.g. character-count) on top of a
73
+ // statically-applied success class, so error must win when both are present.
74
+ &.usa-input--success:not(.usa-input--error) {
75
+ @if $usx-input-success-border-width {
76
+ border-width: $usx-input-success-border-width;
77
+ }
78
+
79
+ @if $usx-input-success-border {
80
+ border-color: $usx-input-success-border;
81
+ }
82
+
83
+ @if $usx-input-success-border-style {
84
+ border-style: $usx-input-success-border-style;
85
+ }
86
+
87
+ @if $usx-input-success-padding-top {
88
+ padding-top: $usx-input-success-padding-top;
89
+ }
90
+
91
+ @if $usx-input-success-padding-bottom {
92
+ padding-bottom: $usx-input-success-padding-bottom;
93
+ }
94
+ }
95
+ }
96
+
97
+ /* ---------------------------------- */
98
+
99
+ /* Focus Enhancements */
100
+
101
+ /* ---------------------------------- */
102
+
103
+ .usa-input.usx-input, .usa-select.usx-select, .usa-combo-box__input {
104
+ &:not([disabled]):focus {
105
+ @if $usx-input-focus-outline {
106
+ outline: $usx-input-focus-outline;
107
+ }
108
+
109
+ @if $usx-input-focus-outline-offset {
110
+ outline-offset: $usx-input-focus-outline-offset;
111
+ }
112
+ }
113
+ }
114
+
115
+ /* ---------------------------------- */
116
+
117
+ /* Theme Corrections */
118
+
119
+ /* ---------------------------------- */
120
+
121
+ @if $usx-color-border {
122
+ .usa-combo-box__input, .usa-input, .usa-input-group, .usa-select, .usa-textarea, .usx-switch {
123
+ border-color: $usx-color-border;
124
+ }
125
+ }
126
+
127
+ @if $usx-border-width-inputs {
128
+ // .usx-switch is excluded here: it manages its own border-width via
129
+ // $usx-switch-border-width (chained to this same token by default) so it
130
+ // can fold the resolved value into its knob/spacing math too, instead of
131
+ // only the border property.
132
+ .usa-combo-box__input, .usa-input, .usa-input-group, .usa-select, .usa-textarea {
133
+ border-width: $usx-border-width-inputs;
134
+ }
135
+ }
@@ -0,0 +1,26 @@
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 the language menu's dropdown to color("primary-darker")
6
+ // bg / white text (a fixed dark treatment, like a nav dropdown) — chain it to
7
+ // the theme's primary-darker shade instead of a static hex.
8
+ .usx-language-selector {
9
+ .usa-language__submenu {
10
+ @if $usx-language-selector-menu-bg {
11
+ background-color: $usx-language-selector-menu-bg;
12
+ }
13
+
14
+ .usa-language__submenu-item a {
15
+ @if $usx-language-selector-menu-text {
16
+ color: $usx-language-selector-menu-text;
17
+ }
18
+
19
+ &:hover {
20
+ @if $usx-language-selector-menu-text {
21
+ color: $usx-language-selector-menu-text;
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,115 @@
1
+ @use 'pkg:@solexllc/usx-theme/variables' as *;
2
+
3
+ /* stylelint-disable selector-class-pattern -- Public USX classes use BEM naming. */
4
+ .usx-layout {
5
+ min-height: 100vh;
6
+
7
+ @if $usx-surface-1 {
8
+ background-color: $usx-surface-1;
9
+ }
10
+
11
+ // ── Single column layout ──────────────────────────────────────────────────
12
+ // Centers content with max-width and responsive gutters
13
+ // | gutter | content (max-width 960px) | gutter |
14
+
15
+ &__single-column {
16
+ max-width: $max-layout-width;
17
+ margin: 0 auto;
18
+ padding: 0 units(2.5);
19
+
20
+ @include at-media('tablet') {
21
+ padding: 0 units(4);
22
+ }
23
+
24
+ @include at-media('desktop') {
25
+ padding: 0;
26
+ }
27
+ }
28
+
29
+ // ── Multi-column grid layout ──────────────────────────────────────────────
30
+ // Supports left/right sidebars that appear on desktop
31
+ // | gutter | left sidebar | content | right sidebar | gutter |
32
+
33
+ &__grid-container {
34
+ display: grid;
35
+ grid-template-rows: auto;
36
+ grid-template-columns:
37
+ [page-start] units(2) [left-sidebar-start] 0 [content-start] minmax(0, $max-layout-width) [content-end] 0 [right-sidebar-end] units(2) [page-end];
38
+
39
+ @include at-media('tablet') {
40
+ grid-template-columns:
41
+ [page-start] units(4) [left-sidebar-start] 0 [content-start] minmax(0, $max-layout-width) [content-end] 0 [right-sidebar-end] units(4) [page-end];
42
+ }
43
+
44
+ @include at-media('desktop') {
45
+ grid-template-columns:
46
+ [page-start] 1fr [left-sidebar-start] $max-sidebar-width [content-start] minmax(0, $max-layout-width) [content-end] $max-sidebar-width [right-sidebar-end] 1fr [page-end];
47
+ }
48
+ }
49
+
50
+ // ── Content areas ─────────────────────────────────────────────────────────
51
+
52
+ &__content {
53
+ grid-column: content-start / span content-end;
54
+ grid-row: 1;
55
+
56
+
57
+ // Content that leaves space for a left sidebar
58
+ // | gutter | left sidebar | content (width dynamic) | gutter |
59
+ &--right {
60
+ grid-column: content-start / span content-end;
61
+ grid-row: 1;
62
+
63
+ @include at-media('desktop') {
64
+ grid-column: content-start / span right-sidebar-end;
65
+ width: $dynamic-content-width;
66
+ margin: 0 units(4) 0 0;
67
+ }
68
+ }
69
+
70
+ // Content that leaves space for the right sidebar
71
+ // | gutter | content (width dynamic) | right sidebar | gutter |
72
+ &--left {
73
+ grid-column: content-start / span content-end;
74
+ grid-row: 1;
75
+
76
+ @include at-media('desktop') {
77
+ grid-column: left-sidebar-start / span content-end;
78
+ width: $dynamic-content-width;
79
+ margin: 0 0 0 units(4);
80
+ justify-self: flex-end;
81
+ }
82
+ }
83
+ }
84
+
85
+ // ── Sidebar areas ─────────────────────────────────────────────────────────
86
+
87
+ &__sidebar--left {
88
+ grid-column: left-sidebar-start / span content-start;
89
+ grid-row: 1;
90
+ }
91
+
92
+ &__sidebar--right {
93
+ grid-column: content-end / span right-sidebar-end;
94
+ grid-row: 1;
95
+ }
96
+
97
+ // Hide sidebars on mobile/tablet, show on desktop
98
+ &__sidebar--right,
99
+ &__sidebar--left {
100
+ display: none;
101
+ padding: 0 units(4);
102
+
103
+ @include at-media('desktop') {
104
+ display: block;
105
+ }
106
+ }
107
+
108
+ &__sidebar--right.usx-layout__sidebar--expanded {
109
+ padding-right: 0;
110
+ }
111
+
112
+ &__sidebar--left.usx-layout__sidebar--expanded {
113
+ padding-left: 0;
114
+ }
115
+ }