unigrid.css 0.3.0 → 0.3.2

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 (44) hide show
  1. package/README.md +101 -101
  2. package/dist/dropdown.js +36 -36
  3. package/dist/scrollspy.js +57 -57
  4. package/dist/tabs.js +30 -30
  5. package/dist/unigrid.css +4608 -4501
  6. package/dist/unigrid.js +173 -124
  7. package/dist/unigrid.min.css +1 -1
  8. package/dist/unigrid.min.js +1 -1
  9. package/package.json +70 -41
  10. package/src/js/dropdown.js +49 -49
  11. package/src/js/index.js +20 -19
  12. package/src/js/modal.js +81 -0
  13. package/src/js/scrollspy.js +87 -87
  14. package/src/js/tabs.js +58 -58
  15. package/src/scss/_accordion.scss +123 -123
  16. package/src/scss/_broadside.scss +125 -125
  17. package/src/scss/_buttons.scss +241 -241
  18. package/src/scss/_card.scss +168 -168
  19. package/src/scss/_components.scss +140 -140
  20. package/src/scss/_container.scss +53 -53
  21. package/src/scss/_dropdown.scss +178 -178
  22. package/src/scss/_footer.scss +147 -147
  23. package/src/scss/_formats.scss +64 -64
  24. package/src/scss/_forms.scss +192 -192
  25. package/src/scss/_grid.scss +114 -114
  26. package/src/scss/_header.scss +169 -169
  27. package/src/scss/_hero.scss +262 -262
  28. package/src/scss/_mixins.scss +120 -120
  29. package/src/scss/_modal.scss +158 -0
  30. package/src/scss/_modules.scss +238 -238
  31. package/src/scss/_navbar.scss +341 -341
  32. package/src/scss/_pagination.scss +160 -160
  33. package/src/scss/_prose.scss +393 -393
  34. package/src/scss/_reset.scss +82 -82
  35. package/src/scss/_scrollspy.scss +62 -62
  36. package/src/scss/_section.scss +91 -91
  37. package/src/scss/_sidebar.scss +147 -147
  38. package/src/scss/_table.scss +122 -122
  39. package/src/scss/_tabs.scss +178 -178
  40. package/src/scss/_typography.scss +105 -105
  41. package/src/scss/_utilities.scss +79 -79
  42. package/src/scss/_variables.scss +183 -183
  43. package/src/scss/unigrid.scss +50 -49
  44. package/dist/index.js +0 -5
@@ -1,393 +1,393 @@
1
- // ==========================================================================
2
- // Unigrid CSS Framework — Prose (BEM)
3
- //
4
- // Long-form typographic content with vertical rhythm, based on Gutenberg
5
- // by Matej Latin. Apply .ug-prose to a container to get beautiful defaults
6
- // for all HTML elements within it.
7
- //
8
- // Features:
9
- // - Vertical rhythm based on leading (line-height as unit)
10
- // - Configurable heading sizes via $ug-headings map
11
- // - Mobile-first with desktop breakpoint at $ug-prose-max-width
12
- // - Typography normalization (abbr, em, sub, sup, mark, etc.)
13
- // - Blockquote, figcaption, code, list, table styling
14
- // - Optional paragraph indent mode
15
- // - Baseline grid debug overlay
16
- //
17
- // Block: .ug-prose
18
- // Modifiers: --indent, --grid, --grid-double
19
- //
20
- // Credit: Based on Gutenberg (github.com/matejlatin/Gutenberg)
21
- // Creative Commons Attribution 3.0
22
- // ==========================================================================
23
-
24
- @use "sass:list";
25
- @use "sass:map";
26
- @use "variables" as *;
27
- @use "mixins" as *;
28
-
29
- .ug-prose {
30
- font-family: $ug-font-family;
31
- color: $ug-color-font-body;
32
- font-size: #{$ug-base}px;
33
- font-size: #{$ug-base-font-size};
34
- @include ug-rhythm-line-height(1);
35
-
36
- @media screen and (min-width: #{$ug-prose-max-width}) {
37
- font-size: #{$ug-base-desktop}px;
38
- font-size: #{$ug-base-font-size-desktop};
39
- }
40
-
41
- @supports (font-variation-settings: normal) {
42
- font-family: $ug-font-family-variable;
43
- }
44
-
45
- // ---- All elements: reset vertical spacing ----
46
- * {
47
- @include ug-rhythm-line-height(1);
48
- @include ug-rhythm-margin-bottom(1);
49
- margin-top: 0;
50
- }
51
-
52
-
53
-
54
- // ---- Max reading width ----
55
- > * {
56
- max-width: #{$ug-prose-max-width};
57
-
58
- @media screen and (min-width: #{$ug-prose-max-width}) {
59
- margin-left: auto;
60
- margin-right: auto;
61
- }
62
- }
63
-
64
- // ---- Headings ----
65
- @each $heading, $props in $ug-headings {
66
- #{$heading} {
67
- @include ug-rhythm-font-size(list.nth($props, 1));
68
- @include ug-rhythm-line-height(list.nth($props, 2));
69
- @include ug-rhythm-margin-top(list.nth($props, 3));
70
- @include ug-rhythm-margin-bottom(list.nth($props, 4));
71
- @include ug-font-weight("bold");
72
-
73
- @if $heading == "h1" {
74
- @include ug-font-weight("black");
75
- letter-spacing: -0.02em;
76
- }
77
- }
78
- }
79
-
80
- // Tighter margins between adjacent headings
81
- h1 + h2 { @include ug-rhythm-margin-top(1); }
82
- h2 + h3,
83
- h3 + h4,
84
- h4 + h5 { @include ug-rhythm-margin-top(0.5); }
85
- h5 + h6 { @include ug-rhythm-margin-top(-0.5); }
86
-
87
- h6 {
88
- font-style: italic;
89
- font-weight: normal;
90
- }
91
-
92
- // ---- Paragraph ----
93
- p {
94
- @include ug-rhythm-margin-bottom(1);
95
- }
96
-
97
- // Attention grabber / lead
98
- .ug-prose__lead,
99
- .attention-grabber {
100
- @include ug-rhythm-font-size(1.2);
101
- }
102
-
103
- // ---- Links ----
104
- a {
105
- color: $ug-color-link;
106
- transition: color 0.2s;
107
-
108
- &:hover {
109
- color: $ug-color-link-hover;
110
- }
111
-
112
- &:visited {
113
- color: $ug-color-link-visited;
114
-
115
- &:hover {
116
- color: $ug-color-link-hover;
117
- }
118
- }
119
- }
120
-
121
- // ---- Inline elements ----
122
- br {
123
- margin-bottom: 0;
124
- }
125
-
126
- abbr {
127
- letter-spacing: 0.1em;
128
- }
129
-
130
- abbr[title] {
131
- border-bottom: 1px dotted;
132
- text-decoration: none;
133
- }
134
-
135
- b,
136
- strong {
137
- @include ug-font-weight("bold");
138
- }
139
-
140
- dfn {
141
- font-style: italic;
142
- }
143
-
144
- em,
145
- i {
146
- line-height: 0;
147
- vertical-align: baseline;
148
- }
149
-
150
- mark {
151
- background: #ff0;
152
- color: #000;
153
- padding: 0 0.2em;
154
- }
155
-
156
- small {
157
- font-size: 70%;
158
- @include ug-rhythm-line-height(0.5);
159
- }
160
-
161
- sub,
162
- sup {
163
- font-size: 75%;
164
- line-height: 0;
165
- position: relative;
166
- vertical-align: baseline;
167
- }
168
-
169
- sup { top: -0.5em; }
170
- sub { bottom: -0.25em; }
171
-
172
- // ---- Blockquote ----
173
- blockquote {
174
- font-style: italic;
175
- padding-left: 1.4375rem;
176
- @include ug-rhythm-margin-top(1);
177
- @include ug-rhythm-margin-bottom(1);
178
-
179
- @media screen and (min-width: #{$ug-prose-max-width}) {
180
- padding-left: 2rem;
181
- }
182
-
183
- cite {
184
- display: block;
185
- font-style: normal;
186
- @include ug-font-size("sm");
187
- color: $ug-color-font-light;
188
- }
189
- }
190
-
191
- // Pull quote (in a figure)
192
- figure blockquote {
193
- @include ug-rhythm-padding(1, 0);
194
- text-align: center;
195
-
196
- p {
197
- @include ug-rhythm-font-size(1.6875);
198
- @include ug-rhythm-line-height(1.5);
199
- }
200
- }
201
-
202
- // ---- Lists ----
203
- ul,
204
- ol {
205
- padding-left: 1.5rem;
206
-
207
- li {
208
- margin-bottom: 0;
209
- }
210
- }
211
-
212
- // ---- Code ----
213
- pre {
214
- overflow: auto;
215
- @include ug-rhythm-padding(1, 1);
216
- background-color: $ug-warm-gray;
217
- border: 1px solid $ug-light-gray;
218
- }
219
-
220
- code,
221
- kbd,
222
- samp {
223
- font-family: "SF Mono", "Fira Code", Consolas, monospace;
224
- @include ug-font-size("sm");
225
- }
226
-
227
- :not(pre) > code {
228
- background-color: $ug-warm-gray;
229
- padding: 0.15em 0.4em;
230
- border-radius: 2px;
231
- }
232
-
233
- // ---- Table ----
234
- table {
235
- border-collapse: collapse;
236
- border-spacing: 0;
237
- width: 100%;
238
- @include ug-rhythm-margin-bottom(1);
239
-
240
- th,
241
- td {
242
- padding: 0.5em 0.75em;
243
- text-align: left;
244
- border-bottom: 1px solid $ug-light-gray;
245
- }
246
-
247
- th {
248
- @include ug-font-weight("bold");
249
- @include ug-font-size("sm");
250
- text-transform: uppercase;
251
- letter-spacing: 0.05em;
252
- }
253
- }
254
-
255
- // ---- Horizontal Rule ----
256
- hr {
257
- border: none;
258
- border-bottom: 1px solid $ug-light-gray;
259
- padding-top: calc(var(--ug-leading) - 1px);
260
- @include ug-rhythm-margin-top(1);
261
- @include ug-rhythm-margin-bottom(1);
262
-
263
- &.ug-divider--bold {
264
- border-bottom: 3px solid $ug-black;
265
- padding-top: calc(var(--ug-leading) - 3px);
266
- }
267
- }
268
-
269
- // ---- Figure & Image ----
270
- figure {
271
- display: block;
272
- @include ug-rhythm-margin-bottom(1);
273
- max-width: 100%;
274
- }
275
-
276
- figcaption {
277
- display: block;
278
- @include ug-font-size("xs");
279
- @include ug-rhythm-line-height(1);
280
- color: $ug-color-font-figcaption;
281
- font-style: italic;
282
- text-align: center;
283
- margin-bottom: 0;
284
- margin-top: 0.5rem;
285
- }
286
-
287
- img {
288
- border: 0;
289
- max-width: 100%;
290
- display: block;
291
- height: auto;
292
- }
293
-
294
- // ---- Form ----
295
- input,
296
- textarea,
297
- select {
298
- font: inherit;
299
- color: inherit;
300
- @include ug-rhythm-margin-bottom(1);
301
- }
302
-
303
- // ==============================
304
- // Modifiers
305
- // ==============================
306
-
307
- // ---- Paragraph Indent Mode ----
308
- &--indent {
309
- p + p {
310
- @include ug-rhythm-margin-top(-1);
311
- text-indent: var(--ug-leading);
312
- text-indent: var(--ug-leading);
313
- }
314
- }
315
-
316
- // ---- Baseline Grid Debug Overlay ----
317
- &--grid {
318
- background-image: linear-gradient(
319
- to bottom,
320
- hsla(200, 100%, 50%, 0.3) 1px,
321
- transparent 1px
322
- );
323
- background-position: left top;
324
- background-repeat: repeat;
325
- background-size: 100% var(--ug-leading);
326
- background-size: 100% var(--ug-leading);
327
- }
328
-
329
- &--grid-double {
330
- background-image: linear-gradient(
331
- to bottom,
332
- hsla(200, 100%, 50%, 0.3) 1px,
333
- transparent 1px,
334
- transparent calc(var(--ug-leading) * 0.5),
335
- hsla(200, 100%, 50%, 0.15) calc(var(--ug-leading) * 0.5),
336
- transparent calc(var(--ug-leading) * 0.5 + 1px),
337
- transparent var(--ug-leading)
338
- );
339
- background-position: left top;
340
- background-repeat: repeat;
341
- background-size: 100% var(--ug-leading);
342
- background-size: 100% var(--ug-leading);
343
- }
344
-
345
- // ---- Debug: Show Margins & Padding ----
346
- // Blue outline = content box
347
- // Orange = margins (top/bottom)
348
- // Green = padding
349
- &--debug {
350
- > * {
351
- outline: 1px solid hsla(210, 80%, 60%, 0.5);
352
- position: relative;
353
-
354
- // Margin visualization (orange glow)
355
- box-shadow:
356
- 0 calc(-1 * var(--debug-mt, 0px)) 0 0 hsla(30, 100%, 60%, 0.15),
357
- 0 calc(var(--debug-mb, 0px)) 0 0 hsla(30, 100%, 60%, 0.15);
358
-
359
- // Padding visualization (green tint) via inset box-shadow on ::before
360
- &::after {
361
- content: "";
362
- position: absolute;
363
- inset: 0;
364
- pointer-events: none;
365
- // Green inset shadow matching the element's padding
366
- box-shadow: inset 0 var(--debug-pt, 0px) 0 0 hsla(140, 70%, 50%, 0.1),
367
- inset 0 calc(-1 * var(--debug-pb, 0px)) 0 0 hsla(140, 70%, 50%, 0.1),
368
- inset var(--debug-pl, 0px) 0 0 0 hsla(140, 70%, 50%, 0.1),
369
- inset calc(-1 * var(--debug-pr, 0px)) 0 0 0 hsla(140, 70%, 50%, 0.1);
370
- }
371
- }
372
-
373
- // Margin vars per element
374
- h1 { --debug-mt: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h1), 3)}); --debug-mb: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h1), 4)}); }
375
- h2 { --debug-mt: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h2), 3)}); --debug-mb: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h2), 4)}); }
376
- h3 { --debug-mt: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h3), 3)}); --debug-mb: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h3), 4)}); }
377
- h4 { --debug-mt: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h4), 3)}); --debug-mb: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h4), 4)}); }
378
- p, ul, ol, table, figure, hr { --debug-mt: 0px; --debug-mb: var(--ug-leading); }
379
-
380
- // Padding vars for elements that have padding
381
- blockquote { --debug-pl: 1.4375rem; --debug-pt: 0px; --debug-pb: 0px; --debug-pr: 0px; --debug-mt: var(--ug-leading); --debug-mb: var(--ug-leading); }
382
- pre { --debug-pt: var(--ug-leading); --debug-pr: var(--ug-leading); --debug-pb: var(--ug-leading); --debug-pl: var(--ug-leading); --debug-mt: 0px; --debug-mb: var(--ug-leading); }
383
- ul, ol { --debug-pl: 1.5rem; }
384
- }
385
-
386
- // ---- Combined: Grid + Debug ----
387
- &--grid#{&}--debug,
388
- &--grid-double#{&}--debug {
389
- > * {
390
- outline: 1px solid hsla(210, 80%, 60%, 0.5);
391
- }
392
- }
393
- }
1
+ // ==========================================================================
2
+ // Unigrid CSS Framework — Prose (BEM)
3
+ //
4
+ // Long-form typographic content with vertical rhythm, based on Gutenberg
5
+ // by Matej Latin. Apply .ug-prose to a container to get beautiful defaults
6
+ // for all HTML elements within it.
7
+ //
8
+ // Features:
9
+ // - Vertical rhythm based on leading (line-height as unit)
10
+ // - Configurable heading sizes via $ug-headings map
11
+ // - Mobile-first with desktop breakpoint at $ug-prose-max-width
12
+ // - Typography normalization (abbr, em, sub, sup, mark, etc.)
13
+ // - Blockquote, figcaption, code, list, table styling
14
+ // - Optional paragraph indent mode
15
+ // - Baseline grid debug overlay
16
+ //
17
+ // Block: .ug-prose
18
+ // Modifiers: --indent, --grid, --grid-double
19
+ //
20
+ // Credit: Based on Gutenberg (github.com/matejlatin/Gutenberg)
21
+ // Creative Commons Attribution 3.0
22
+ // ==========================================================================
23
+
24
+ @use "sass:list";
25
+ @use "sass:map";
26
+ @use "variables" as *;
27
+ @use "mixins" as *;
28
+
29
+ .ug-prose {
30
+ font-family: $ug-font-family;
31
+ color: $ug-color-font-body;
32
+ font-size: #{$ug-base}px;
33
+ font-size: #{$ug-base-font-size};
34
+ @include ug-rhythm-line-height(1);
35
+
36
+ @media screen and (min-width: #{$ug-prose-max-width}) {
37
+ font-size: #{$ug-base-desktop}px;
38
+ font-size: #{$ug-base-font-size-desktop};
39
+ }
40
+
41
+ @supports (font-variation-settings: normal) {
42
+ font-family: $ug-font-family-variable;
43
+ }
44
+
45
+ // ---- All elements: reset vertical spacing ----
46
+ * {
47
+ @include ug-rhythm-line-height(1);
48
+ @include ug-rhythm-margin-bottom(1);
49
+ margin-top: 0;
50
+ }
51
+
52
+
53
+
54
+ // ---- Max reading width ----
55
+ > * {
56
+ max-width: #{$ug-prose-max-width};
57
+
58
+ @media screen and (min-width: #{$ug-prose-max-width}) {
59
+ margin-left: auto;
60
+ margin-right: auto;
61
+ }
62
+ }
63
+
64
+ // ---- Headings ----
65
+ @each $heading, $props in $ug-headings {
66
+ #{$heading} {
67
+ @include ug-rhythm-font-size(list.nth($props, 1));
68
+ @include ug-rhythm-line-height(list.nth($props, 2));
69
+ @include ug-rhythm-margin-top(list.nth($props, 3));
70
+ @include ug-rhythm-margin-bottom(list.nth($props, 4));
71
+ @include ug-font-weight("bold");
72
+
73
+ @if $heading == "h1" {
74
+ @include ug-font-weight("black");
75
+ letter-spacing: -0.02em;
76
+ }
77
+ }
78
+ }
79
+
80
+ // Tighter margins between adjacent headings
81
+ h1 + h2 { @include ug-rhythm-margin-top(1); }
82
+ h2 + h3,
83
+ h3 + h4,
84
+ h4 + h5 { @include ug-rhythm-margin-top(0.5); }
85
+ h5 + h6 { @include ug-rhythm-margin-top(-0.5); }
86
+
87
+ h6 {
88
+ font-style: italic;
89
+ font-weight: normal;
90
+ }
91
+
92
+ // ---- Paragraph ----
93
+ p {
94
+ @include ug-rhythm-margin-bottom(1);
95
+ }
96
+
97
+ // Attention grabber / lead
98
+ .ug-prose__lead,
99
+ .attention-grabber {
100
+ @include ug-rhythm-font-size(1.2);
101
+ }
102
+
103
+ // ---- Links ----
104
+ a {
105
+ color: $ug-color-link;
106
+ transition: color 0.2s;
107
+
108
+ &:hover {
109
+ color: $ug-color-link-hover;
110
+ }
111
+
112
+ &:visited {
113
+ color: $ug-color-link-visited;
114
+
115
+ &:hover {
116
+ color: $ug-color-link-hover;
117
+ }
118
+ }
119
+ }
120
+
121
+ // ---- Inline elements ----
122
+ br {
123
+ margin-bottom: 0;
124
+ }
125
+
126
+ abbr {
127
+ letter-spacing: 0.1em;
128
+ }
129
+
130
+ abbr[title] {
131
+ border-bottom: 1px dotted;
132
+ text-decoration: none;
133
+ }
134
+
135
+ b,
136
+ strong {
137
+ @include ug-font-weight("bold");
138
+ }
139
+
140
+ dfn {
141
+ font-style: italic;
142
+ }
143
+
144
+ em,
145
+ i {
146
+ line-height: 0;
147
+ vertical-align: baseline;
148
+ }
149
+
150
+ mark {
151
+ background: #ff0;
152
+ color: #000;
153
+ padding: 0 0.2em;
154
+ }
155
+
156
+ small {
157
+ font-size: 70%;
158
+ @include ug-rhythm-line-height(0.5);
159
+ }
160
+
161
+ sub,
162
+ sup {
163
+ font-size: 75%;
164
+ line-height: 0;
165
+ position: relative;
166
+ vertical-align: baseline;
167
+ }
168
+
169
+ sup { top: -0.5em; }
170
+ sub { bottom: -0.25em; }
171
+
172
+ // ---- Blockquote ----
173
+ blockquote {
174
+ font-style: italic;
175
+ padding-left: 1.4375rem;
176
+ @include ug-rhythm-margin-top(1);
177
+ @include ug-rhythm-margin-bottom(1);
178
+
179
+ @media screen and (min-width: #{$ug-prose-max-width}) {
180
+ padding-left: 2rem;
181
+ }
182
+
183
+ cite {
184
+ display: block;
185
+ font-style: normal;
186
+ @include ug-font-size("sm");
187
+ color: $ug-color-font-light;
188
+ }
189
+ }
190
+
191
+ // Pull quote (in a figure)
192
+ figure blockquote {
193
+ @include ug-rhythm-padding(1, 0);
194
+ text-align: center;
195
+
196
+ p {
197
+ @include ug-rhythm-font-size(1.6875);
198
+ @include ug-rhythm-line-height(1.5);
199
+ }
200
+ }
201
+
202
+ // ---- Lists ----
203
+ ul,
204
+ ol {
205
+ padding-left: 1.5rem;
206
+
207
+ li {
208
+ margin-bottom: 0;
209
+ }
210
+ }
211
+
212
+ // ---- Code ----
213
+ pre {
214
+ overflow: auto;
215
+ @include ug-rhythm-padding(1, 1);
216
+ background-color: $ug-warm-gray;
217
+ border: 1px solid $ug-light-gray;
218
+ }
219
+
220
+ code,
221
+ kbd,
222
+ samp {
223
+ font-family: "SF Mono", "Fira Code", Consolas, monospace;
224
+ @include ug-font-size("sm");
225
+ }
226
+
227
+ :not(pre) > code {
228
+ background-color: $ug-warm-gray;
229
+ padding: 0.15em 0.4em;
230
+ border-radius: 2px;
231
+ }
232
+
233
+ // ---- Table ----
234
+ table {
235
+ border-collapse: collapse;
236
+ border-spacing: 0;
237
+ width: 100%;
238
+ @include ug-rhythm-margin-bottom(1);
239
+
240
+ th,
241
+ td {
242
+ padding: 0.5em 0.75em;
243
+ text-align: left;
244
+ border-bottom: 1px solid $ug-light-gray;
245
+ }
246
+
247
+ th {
248
+ @include ug-font-weight("bold");
249
+ @include ug-font-size("sm");
250
+ text-transform: uppercase;
251
+ letter-spacing: 0.05em;
252
+ }
253
+ }
254
+
255
+ // ---- Horizontal Rule ----
256
+ hr {
257
+ border: none;
258
+ border-bottom: 1px solid $ug-light-gray;
259
+ padding-top: calc(var(--ug-leading) - 1px);
260
+ @include ug-rhythm-margin-top(1);
261
+ @include ug-rhythm-margin-bottom(1);
262
+
263
+ &.ug-divider--bold {
264
+ border-bottom: 3px solid $ug-black;
265
+ padding-top: calc(var(--ug-leading) - 3px);
266
+ }
267
+ }
268
+
269
+ // ---- Figure & Image ----
270
+ figure {
271
+ display: block;
272
+ @include ug-rhythm-margin-bottom(1);
273
+ max-width: 100%;
274
+ }
275
+
276
+ figcaption {
277
+ display: block;
278
+ @include ug-font-size("xs");
279
+ @include ug-rhythm-line-height(1);
280
+ color: $ug-color-font-figcaption;
281
+ font-style: italic;
282
+ text-align: center;
283
+ margin-bottom: 0;
284
+ margin-top: 0.5rem;
285
+ }
286
+
287
+ img {
288
+ border: 0;
289
+ max-width: 100%;
290
+ display: block;
291
+ height: auto;
292
+ }
293
+
294
+ // ---- Form ----
295
+ input,
296
+ textarea,
297
+ select {
298
+ font: inherit;
299
+ color: inherit;
300
+ @include ug-rhythm-margin-bottom(1);
301
+ }
302
+
303
+ // ==============================
304
+ // Modifiers
305
+ // ==============================
306
+
307
+ // ---- Paragraph Indent Mode ----
308
+ &--indent {
309
+ p + p {
310
+ @include ug-rhythm-margin-top(-1);
311
+ text-indent: var(--ug-leading);
312
+ text-indent: var(--ug-leading);
313
+ }
314
+ }
315
+
316
+ // ---- Baseline Grid Debug Overlay ----
317
+ &--grid {
318
+ background-image: linear-gradient(
319
+ to bottom,
320
+ hsla(200, 100%, 50%, 0.3) 1px,
321
+ transparent 1px
322
+ );
323
+ background-position: left top;
324
+ background-repeat: repeat;
325
+ background-size: 100% var(--ug-leading);
326
+ background-size: 100% var(--ug-leading);
327
+ }
328
+
329
+ &--grid-double {
330
+ background-image: linear-gradient(
331
+ to bottom,
332
+ hsla(200, 100%, 50%, 0.3) 1px,
333
+ transparent 1px,
334
+ transparent calc(var(--ug-leading) * 0.5),
335
+ hsla(200, 100%, 50%, 0.15) calc(var(--ug-leading) * 0.5),
336
+ transparent calc(var(--ug-leading) * 0.5 + 1px),
337
+ transparent var(--ug-leading)
338
+ );
339
+ background-position: left top;
340
+ background-repeat: repeat;
341
+ background-size: 100% var(--ug-leading);
342
+ background-size: 100% var(--ug-leading);
343
+ }
344
+
345
+ // ---- Debug: Show Margins & Padding ----
346
+ // Blue outline = content box
347
+ // Orange = margins (top/bottom)
348
+ // Green = padding
349
+ &--debug {
350
+ > * {
351
+ outline: 1px solid hsla(210, 80%, 60%, 0.5);
352
+ position: relative;
353
+
354
+ // Margin visualization (orange glow)
355
+ box-shadow:
356
+ 0 calc(-1 * var(--debug-mt, 0px)) 0 0 hsla(30, 100%, 60%, 0.15),
357
+ 0 calc(var(--debug-mb, 0px)) 0 0 hsla(30, 100%, 60%, 0.15);
358
+
359
+ // Padding visualization (green tint) via inset box-shadow on ::before
360
+ &::after {
361
+ content: "";
362
+ position: absolute;
363
+ inset: 0;
364
+ pointer-events: none;
365
+ // Green inset shadow matching the element's padding
366
+ box-shadow: inset 0 var(--debug-pt, 0px) 0 0 hsla(140, 70%, 50%, 0.1),
367
+ inset 0 calc(-1 * var(--debug-pb, 0px)) 0 0 hsla(140, 70%, 50%, 0.1),
368
+ inset var(--debug-pl, 0px) 0 0 0 hsla(140, 70%, 50%, 0.1),
369
+ inset calc(-1 * var(--debug-pr, 0px)) 0 0 0 hsla(140, 70%, 50%, 0.1);
370
+ }
371
+ }
372
+
373
+ // Margin vars per element
374
+ h1 { --debug-mt: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h1), 3)}); --debug-mb: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h1), 4)}); }
375
+ h2 { --debug-mt: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h2), 3)}); --debug-mb: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h2), 4)}); }
376
+ h3 { --debug-mt: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h3), 3)}); --debug-mb: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h3), 4)}); }
377
+ h4 { --debug-mt: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h4), 3)}); --debug-mb: calc(var(--ug-leading) * #{list.nth(map.get($ug-headings, h4), 4)}); }
378
+ p, ul, ol, table, figure, hr { --debug-mt: 0px; --debug-mb: var(--ug-leading); }
379
+
380
+ // Padding vars for elements that have padding
381
+ blockquote { --debug-pl: 1.4375rem; --debug-pt: 0px; --debug-pb: 0px; --debug-pr: 0px; --debug-mt: var(--ug-leading); --debug-mb: var(--ug-leading); }
382
+ pre { --debug-pt: var(--ug-leading); --debug-pr: var(--ug-leading); --debug-pb: var(--ug-leading); --debug-pl: var(--ug-leading); --debug-mt: 0px; --debug-mb: var(--ug-leading); }
383
+ ul, ol { --debug-pl: 1.5rem; }
384
+ }
385
+
386
+ // ---- Combined: Grid + Debug ----
387
+ &--grid#{&}--debug,
388
+ &--grid-double#{&}--debug {
389
+ > * {
390
+ outline: 1px solid hsla(210, 80%, 60%, 0.5);
391
+ }
392
+ }
393
+ }