uswds-extended 3.13.1 → 3.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uswds-extended",
3
- "version": "3.13.1",
3
+ "version": "3.14.0",
4
4
  "description": "USWDS with Tailwind-style utilities: color opacity, arbitrary values, @apply directive, and more",
5
5
  "engines": {
6
6
  "node": ">= 18"
@@ -233,10 +233,12 @@ $system-properties: (
233
233
  standard: (
234
234
  "block": block,
235
235
  "flex": flex,
236
+ "grid": grid,
236
237
  "none": none,
237
238
  "inline": inline,
238
239
  "inline-block": inline-block,
239
240
  "inline-flex": inline-flex,
241
+ "inline-grid": inline-grid,
240
242
  "table": table,
241
243
  "table-cell": table-cell,
242
244
  "table-row": table-row,
@@ -13,6 +13,7 @@
13
13
  @forward "circle";
14
14
  @forward "clearfix";
15
15
  @forward "color";
16
+ @forward "css-grid";
16
17
  @forward "cursor";
17
18
  @forward "display";
18
19
  @forward "float";
@@ -62,5 +62,6 @@ $utilities-package: map-collect(
62
62
  $u-vertical-align,
63
63
  $u-whitespace,
64
64
  $u-width,
65
- $u-z-index
65
+ $u-z-index,
66
+ $u-css-grid
66
67
  );
@@ -0,0 +1,209 @@
1
+ /*
2
+ ========================================
3
+ CSS Grid Utilities
4
+ ----------------------------------------
5
+ These utilities provide CSS Grid layout support,
6
+ distinct from USWDS's flexbox-based grid system.
7
+
8
+ Key differences:
9
+ - USWDS Flexbox: .grid-row + .grid-col-6 (item width)
10
+ - CSS Grid: .display-grid + .grid-cols-6 (container columns)
11
+
12
+ usage:
13
+ .grid-cols-[n] - n equal columns
14
+ .grid-rows-[n] - n equal rows
15
+ .col-span-[n] - span n columns
16
+ .row-span-[n] - span n rows
17
+ .col-start-[n] - start at column line n
18
+ .row-start-[n] - start at row line n
19
+ ----------------------------------------
20
+ example:
21
+ <div class="display-grid grid-cols-3 gap-2">
22
+ <div class="col-span-2">Wide item</div>
23
+ <div>Regular item</div>
24
+ </div>
25
+ ----------------------------------------
26
+ */
27
+
28
+ @use "uswds-core/src/styles/settings" as *;
29
+ @use "uswds-core/src/styles/functions" as *;
30
+ @use "../functions/" as *;
31
+
32
+ // Grid template columns (1-12)
33
+ $grid-cols-values: (
34
+ "1": repeat(1, minmax(0, 1fr)),
35
+ "2": repeat(2, minmax(0, 1fr)),
36
+ "3": repeat(3, minmax(0, 1fr)),
37
+ "4": repeat(4, minmax(0, 1fr)),
38
+ "5": repeat(5, minmax(0, 1fr)),
39
+ "6": repeat(6, minmax(0, 1fr)),
40
+ "7": repeat(7, minmax(0, 1fr)),
41
+ "8": repeat(8, minmax(0, 1fr)),
42
+ "9": repeat(9, minmax(0, 1fr)),
43
+ "10": repeat(10, minmax(0, 1fr)),
44
+ "11": repeat(11, minmax(0, 1fr)),
45
+ "12": repeat(12, minmax(0, 1fr)),
46
+ "none": none,
47
+ );
48
+
49
+ // Grid template rows (1-6)
50
+ $grid-rows-values: (
51
+ "1": repeat(1, minmax(0, 1fr)),
52
+ "2": repeat(2, minmax(0, 1fr)),
53
+ "3": repeat(3, minmax(0, 1fr)),
54
+ "4": repeat(4, minmax(0, 1fr)),
55
+ "5": repeat(5, minmax(0, 1fr)),
56
+ "6": repeat(6, minmax(0, 1fr)),
57
+ "none": none,
58
+ );
59
+
60
+ // Column span values
61
+ $col-span-values: (
62
+ "1": span 1 / span 1,
63
+ "2": span 2 / span 2,
64
+ "3": span 3 / span 3,
65
+ "4": span 4 / span 4,
66
+ "5": span 5 / span 5,
67
+ "6": span 6 / span 6,
68
+ "7": span 7 / span 7,
69
+ "8": span 8 / span 8,
70
+ "9": span 9 / span 9,
71
+ "10": span 10 / span 10,
72
+ "11": span 11 / span 11,
73
+ "12": span 12 / span 12,
74
+ "full": 1 / -1,
75
+ "auto": auto,
76
+ );
77
+
78
+ // Row span values
79
+ $row-span-values: (
80
+ "1": span 1 / span 1,
81
+ "2": span 2 / span 2,
82
+ "3": span 3 / span 3,
83
+ "4": span 4 / span 4,
84
+ "5": span 5 / span 5,
85
+ "6": span 6 / span 6,
86
+ "full": 1 / -1,
87
+ "auto": auto,
88
+ );
89
+
90
+ // Column/row start values (line numbers)
91
+ $grid-line-values: (
92
+ "1": 1,
93
+ "2": 2,
94
+ "3": 3,
95
+ "4": 4,
96
+ "5": 5,
97
+ "6": 6,
98
+ "7": 7,
99
+ "8": 8,
100
+ "9": 9,
101
+ "10": 10,
102
+ "11": 11,
103
+ "12": 12,
104
+ "13": 13,
105
+ "auto": auto,
106
+ );
107
+
108
+ // Grid auto flow values
109
+ $grid-flow-values: (
110
+ "row": row,
111
+ "col": column,
112
+ "dense": dense,
113
+ "row-dense": row dense,
114
+ "col-dense": column dense,
115
+ );
116
+
117
+ // Settings for CSS Grid utilities
118
+ $css-grid-settings: (
119
+ output: true,
120
+ responsive: true,
121
+ hover: false,
122
+ active: false,
123
+ visited: false,
124
+ focus: false,
125
+ );
126
+
127
+ $u-css-grid: (
128
+ // grid-template-columns
129
+ grid-cols: (
130
+ base: "grid-cols",
131
+ modifiers: null,
132
+ values: $grid-cols-values,
133
+ settings: $css-grid-settings,
134
+ property: "grid-template-columns",
135
+ type: "utility",
136
+ ),
137
+ // grid-template-rows
138
+ grid-rows: (
139
+ base: "grid-rows",
140
+ modifiers: null,
141
+ values: $grid-rows-values,
142
+ settings: $css-grid-settings,
143
+ property: "grid-template-rows",
144
+ type: "utility",
145
+ ),
146
+ // grid-column (span)
147
+ col-span: (
148
+ base: "col-span",
149
+ modifiers: null,
150
+ values: $col-span-values,
151
+ settings: $css-grid-settings,
152
+ property: "grid-column",
153
+ type: "utility",
154
+ ),
155
+ // grid-row (span)
156
+ row-span: (
157
+ base: "row-span",
158
+ modifiers: null,
159
+ values: $row-span-values,
160
+ settings: $css-grid-settings,
161
+ property: "grid-row",
162
+ type: "utility",
163
+ ),
164
+ // grid-column-start
165
+ col-start: (
166
+ base: "col-start",
167
+ modifiers: null,
168
+ values: $grid-line-values,
169
+ settings: $css-grid-settings,
170
+ property: "grid-column-start",
171
+ type: "utility",
172
+ ),
173
+ // grid-column-end
174
+ col-end: (
175
+ base: "col-end",
176
+ modifiers: null,
177
+ values: $grid-line-values,
178
+ settings: $css-grid-settings,
179
+ property: "grid-column-end",
180
+ type: "utility",
181
+ ),
182
+ // grid-row-start
183
+ row-start: (
184
+ base: "row-start",
185
+ modifiers: null,
186
+ values: $grid-line-values,
187
+ settings: $css-grid-settings,
188
+ property: "grid-row-start",
189
+ type: "utility",
190
+ ),
191
+ // grid-row-end
192
+ row-end: (
193
+ base: "row-end",
194
+ modifiers: null,
195
+ values: $grid-line-values,
196
+ settings: $css-grid-settings,
197
+ property: "grid-row-end",
198
+ type: "utility",
199
+ ),
200
+ // grid-auto-flow
201
+ grid-flow: (
202
+ base: "grid-flow",
203
+ modifiers: null,
204
+ values: $grid-flow-values,
205
+ settings: $css-grid-settings,
206
+ property: "grid-auto-flow",
207
+ type: "utility",
208
+ ),
209
+ );