@codeforamerica/marcomms-design-system 1.19.0 → 1.20.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 (105) hide show
  1. package/dist/components/card.js +4 -0
  2. package/dist/components/label.js +4 -0
  3. package/dist/components/logo-card.js +4 -0
  4. package/dist/components/pager.js +7 -3
  5. package/dist/components/person-card.js +5 -1
  6. package/dist/components/promo.js +4 -0
  7. package/dist/components/stat.js +4 -0
  8. package/dist/components/tab-list.js +5 -1
  9. package/dist/components/tab.js +4 -0
  10. package/dist/components/tile.js +4 -0
  11. package/dist/components/transcript.js +4 -0
  12. package/dist/core.css +1 -1
  13. package/dist/index.js +4 -0
  14. package/dist/styles.css +1 -1
  15. package/package.json +2 -1
  16. package/src/components/accordion.js +141 -0
  17. package/src/components/accordion.stories.js +56 -0
  18. package/src/components/avatar.js +62 -0
  19. package/src/components/avatar.stories.js +27 -0
  20. package/src/components/bar.js +102 -0
  21. package/src/components/bar.stories.js +22 -0
  22. package/src/components/blob.js +128 -0
  23. package/src/components/blob.stories.js +73 -0
  24. package/src/components/box.js +55 -0
  25. package/src/components/box.stories.js +24 -0
  26. package/src/components/breadcrumbs.js +80 -0
  27. package/src/components/breadcrumbs.stories.js +27 -0
  28. package/src/components/button.js +163 -0
  29. package/src/components/button.scss +157 -0
  30. package/src/components/button.stories.js +49 -0
  31. package/src/components/callout.js +62 -0
  32. package/src/components/callout.stories.js +20 -0
  33. package/src/components/card.js +456 -0
  34. package/src/components/card.stories.js +227 -0
  35. package/src/components/carousel.js +662 -0
  36. package/src/components/carousel.stories.js +165 -0
  37. package/src/components/details.scss +71 -0
  38. package/src/components/details.stories.js +27 -0
  39. package/src/components/form-elements.scss +304 -0
  40. package/src/components/form-elements.stories.js +134 -0
  41. package/src/components/icon.js +44 -0
  42. package/src/components/icon.scss +32 -0
  43. package/src/components/icon.stories.js +38 -0
  44. package/src/components/label.js +63 -0
  45. package/src/components/label.stories.js +29 -0
  46. package/src/components/link-list.scss +80 -0
  47. package/src/components/link-list.stories.js +52 -0
  48. package/src/components/loader.scss +24 -0
  49. package/src/components/loader.stories.js +12 -0
  50. package/src/components/logo-card.js +93 -0
  51. package/src/components/logo-card.stories.js +48 -0
  52. package/src/components/nav.js +98 -0
  53. package/src/components/nav.stories.js +40 -0
  54. package/src/components/page-nav.js +171 -0
  55. package/src/components/page-nav.stories.js +112 -0
  56. package/src/components/pager.js +98 -0
  57. package/src/components/pager.stories.js +30 -0
  58. package/src/components/pagination.js +116 -0
  59. package/src/components/pagination.stories.js +30 -0
  60. package/src/components/person-card.js +240 -0
  61. package/src/components/person-card.stories.js +58 -0
  62. package/src/components/pill.js +33 -0
  63. package/src/components/pill.stories.js +25 -0
  64. package/src/components/placeholder.js +25 -0
  65. package/src/components/placeholder.stories.js +10 -0
  66. package/src/components/promo.js +82 -0
  67. package/src/components/promo.stories.js +37 -0
  68. package/src/components/pullquote.js +42 -0
  69. package/src/components/pullquote.stories.js +16 -0
  70. package/src/components/quote.js +111 -0
  71. package/src/components/quote.stories.js +23 -0
  72. package/src/components/reveal.js +83 -0
  73. package/src/components/reveal.stories.js +40 -0
  74. package/src/components/slide.js +122 -0
  75. package/src/components/slide.stories.js +49 -0
  76. package/src/components/social-icon.js +236 -0
  77. package/src/components/social-icon.stories.js +36 -0
  78. package/src/components/stat.js +92 -0
  79. package/src/components/stat.stories.js +28 -0
  80. package/src/components/tab-list.js +114 -0
  81. package/src/components/tab-list.stories.js +18 -0
  82. package/src/components/tab.js +95 -0
  83. package/src/components/tab.stories.js +29 -0
  84. package/src/components/tile.js +149 -0
  85. package/src/components/tile.stories.js +41 -0
  86. package/src/components/transcript.js +44 -0
  87. package/src/components/transcript.stories.js +103 -0
  88. package/src/core/base.scss +86 -0
  89. package/src/core/colors.mdx +100 -0
  90. package/src/core/grid.mdx +244 -0
  91. package/src/core/grid.scss +394 -0
  92. package/src/core/helpers.scss +111 -0
  93. package/src/core/layout.scss +103 -0
  94. package/src/core/layout.stories.js +145 -0
  95. package/src/core/reset.scss +53 -0
  96. package/src/core/shadows.mdx +108 -0
  97. package/src/core/tokens.scss +261 -0
  98. package/src/core/typography.mdx +79 -0
  99. package/src/core/typography.scss +415 -0
  100. package/src/core.js +10 -0
  101. package/src/index.js +43 -0
  102. package/src/shared/common.js +65 -0
  103. package/src/shared/layout.js +14 -0
  104. package/src/shared/typography.js +401 -0
  105. package/src/styles.scss +15 -0
@@ -0,0 +1,401 @@
1
+ import { css } from "lit";
2
+
3
+ export const typographyStyles = css`
4
+ // =====
5
+
6
+ // Typography spacing
7
+
8
+ // Add a single space around paragraphs, blockquotes, and lists
9
+ p, ul, ol, blockquote {
10
+ & + * {
11
+ margin-block-start: var(--spacing, var(--spacing-layout-1, 1.5rem));
12
+ }
13
+ * + & {
14
+ margin-block-start: var(--spacing, var(--spacing-layout-1, 1.5rem));
15
+ }
16
+ }
17
+
18
+ h1, h2, h3, h4, .h1, .h2, .h3, .h4, .display-1, .display-2 {
19
+ // Add a single line space after headings
20
+ & + * {
21
+ margin-block-start: var(--spacing, var(--spacing-layout-1, 1.5rem));
22
+ }
23
+
24
+ // Add two line spaces before headings
25
+ * + & {
26
+ --spacing: var(--spacing-layout-2);
27
+
28
+ margin-block-start: --spacing;
29
+ }
30
+
31
+ // Only add a single space between headings and other headings
32
+ & + & {
33
+ --spacing: var(--spacing-layout-1);
34
+ }
35
+
36
+ // Reduce space after breadcrumbs and eyebrows
37
+ cfa-breadcrumbs + & {
38
+ margin-block-start: var(--spacing-layout-half) !important;
39
+ }
40
+
41
+ .eyebrow + & {
42
+ margin-block-start: 0 !important;
43
+ }
44
+ }
45
+
46
+ h1, .h1, .display-1, .display-2 {
47
+ text-wrap: balance;
48
+ }
49
+
50
+ // =====
51
+
52
+ // Font styles
53
+
54
+ .regular {
55
+ font-family: var(--font-family-base);
56
+ font-size: var(--font-size-base);
57
+ line-height: var(--line-height-base);
58
+ }
59
+
60
+ .display-1 {
61
+ font-family: var(--font-family-heading);
62
+ font-size: var(--font-size-display-1);
63
+ font-weight: bold;
64
+ line-height: var(--line-height-display-1);
65
+ letter-spacing: var(--letter-spacing-display-1);
66
+ }
67
+
68
+ .display-2 {
69
+ font-family: var(--font-family-heading);
70
+ font-size: var(--font-size-display-2);
71
+ font-weight: bold;
72
+ line-height: var(--line-height-display-2);
73
+ letter-spacing: var(--letter-spacing-display-2);
74
+ }
75
+
76
+ h1,
77
+ .h1 {
78
+ font-family: var(--font-family-heading);
79
+ font-size: var(--font-size-h1);
80
+ font-weight: bold;
81
+ line-height: var(--line-height-h1);
82
+ letter-spacing: var(--letter-spacing-h1);
83
+ }
84
+
85
+ h2,
86
+ .h2 {
87
+ font-family: var(--font-family-heading);
88
+ font-size: var(--font-size-h2);
89
+ font-weight: bold;
90
+ line-height: var(--line-height-h2);
91
+ letter-spacing: var(--letter-spacing-h2);
92
+ }
93
+
94
+ h3,
95
+ .h3 {
96
+ font-family: var(--font-family-heading);
97
+ font-size: var(--font-size-h3);
98
+ font-weight: bold;
99
+ line-height: var(--line-height-h3);
100
+ letter-spacing: var(--letter-spacing-h3);
101
+ }
102
+
103
+ h4,
104
+ .h4 {
105
+ font-family: var(--font-family-heading);
106
+ font-size: var(--font-size-h4);
107
+ font-weight: bold;
108
+ line-height: var(--line-height-h4);
109
+ letter-spacing: var(--letter-spacing-h4);
110
+ }
111
+
112
+ .extra-large {
113
+ font-size: var(--font-size-extra-large);
114
+ line-height: var(--line-height-extra-large);
115
+ letter-spacing: var(--letter-spacing-extra-large);
116
+ }
117
+
118
+ .large {
119
+ font-size: var(--font-size-large);
120
+ line-height: var(--line-height-large);
121
+ letter-spacing: var(--letter-spacing-large);
122
+ }
123
+
124
+ .small {
125
+ font-size: var(--font-size-small);
126
+ line-height: var(--line-height-small);
127
+ letter-spacing: var(--letter-spacing-small);
128
+ }
129
+
130
+ .eyebrow {
131
+ font-family: var(--font-family-sans-serif);
132
+ font-size: var(--font-size-eyebrow);
133
+ font-weight: var(--font-weight-eyebrow);
134
+ letter-spacing: var(--letter-spacing-eyebrow);
135
+ line-height: var(--line-height-eyebrow);
136
+ text-transform: uppercase;
137
+ }
138
+
139
+ .eyebrow-with-line {
140
+ align-items: center;
141
+ color: var(--text-color);
142
+ display: flex;
143
+ font-family: var(--font-family-eyebrow);
144
+ font-size: var(--font-size-eyebrow);
145
+ font-weight: var(--font-weight-eyebrow);
146
+ letter-spacing: var(--letter-spacing-eyebrow);
147
+ line-height: var(--line-height-eyebrow);
148
+ margin-block-end: var(--spacing-layout-half);
149
+ position: relative;
150
+ text-transform: uppercase;
151
+
152
+ &::after {
153
+ border-block-end: var(--hairline) solid currentColor;
154
+ content: "";
155
+ flex-grow: 1;
156
+ margin-left: var(--spacing-component-3);
157
+ }
158
+ }
159
+
160
+ .subtle {
161
+ opacity: 0.6;
162
+ }
163
+
164
+ .serif {
165
+ font-family: var(--font-family-serif);
166
+ }
167
+
168
+ .sans-serif {
169
+ font-family: var(--font-family-sans-serif);
170
+ }
171
+
172
+ i,
173
+ em,
174
+ .italic {
175
+ font-style: italic;
176
+ }
177
+
178
+ b,
179
+ strong,
180
+ .strong {
181
+ font-weight: bold;
182
+ }
183
+
184
+ .normal {
185
+ font-weight: normal;
186
+ }
187
+
188
+ .balance {
189
+ text-wrap: balance;
190
+ }
191
+
192
+ .prominent-link,
193
+ a.prominent-link {
194
+ --accent-color: var(--purple-60);
195
+
196
+ font-weight: bold;
197
+ text-decoration: underline;
198
+ text-decoration-color: var(--accent-color);
199
+ text-decoration-thickness: var(--medium);
200
+ text-underline-offset: 0.4em;
201
+ transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
202
+
203
+ &:hover {
204
+ --accent-color: var(--red-60);
205
+ }
206
+
207
+ &:not(:has(cfa-icon))::after {
208
+ @include icon.icon;
209
+
210
+ content: "arrow_right_alt";
211
+ display: inline-block;
212
+ padding-inline-start: 0.1em;
213
+ text-decoration: none;
214
+ transition: padding 0.2s ease-in-out;
215
+ width: 1em;
216
+ }
217
+
218
+ &:not(:has(cfa-icon)):hover::after {
219
+ padding-inline-start: 0.3em;
220
+ }
221
+
222
+ cfa-icon {
223
+ text-decoration: none;
224
+ }
225
+ }
226
+
227
+ .white-text,
228
+ .text-light /* fallback */ {
229
+ -moz-osx-font-smoothing: grayscale; // Sharper antialising for white text on a dark background
230
+ -webkit-font-smoothing: antialiased; // Sharper antialising for white text on a dark background
231
+ color: var(--white);
232
+ --link-color: var(--white);
233
+ --link-hover-color: var(--white);
234
+ }
235
+
236
+ // =====
237
+
238
+ // Highlights
239
+
240
+ .highlight {
241
+ --highlight-offset: 0.2em;
242
+
243
+ box-decoration-break: clone;
244
+ display: inline;
245
+ background: linear-gradient(to top, transparent 0%, transparent var(--highlight-offset), var(--highlight-color) var(--highlight-offset), var(--highlight-color) calc(var(--highlight-offset) + var(--highlight-thickness)), transparent calc(var(--highlight-offset) + var(--highlight-thickness)), transparent 100%);
246
+ padding-inline: 0.1em;
247
+ -webkit-box-decoration-break: clone;
248
+ margin-inline-start: -0.1em;
249
+ margin-inline-end: -0.1em;
250
+ word-wrap: break-word;
251
+ }
252
+
253
+ // ======
254
+
255
+ // Lists
256
+
257
+ .ul {
258
+ list-style-type: disc;
259
+ padding-left: var(--spacing-layout-1);
260
+ }
261
+
262
+ .ul > li {
263
+ margin-inline-start: 0;
264
+ padding-left: var(--spacing-component-2);
265
+ }
266
+
267
+ .ul > li + li {
268
+ margin-block-start: var(--spacing-layout-half);
269
+ }
270
+
271
+ .ul > li > ul {
272
+ margin-block-start: var(--spacing-layout-half);
273
+ }
274
+
275
+ .ol {
276
+ list-style-type: decimal;
277
+ padding-left: var(--spacing-layout-1);
278
+ }
279
+
280
+ .ol > li {
281
+ margin-inline-start: 0;
282
+ padding-inline-start: var(--spacing-component-2);
283
+ }
284
+
285
+ .ol > li + li {
286
+ margin-block-start: var(--spacing-layout-half);
287
+ }
288
+
289
+ .ol > li > ul {
290
+ margin-block-start: var(--spacing-layout-half);
291
+ }
292
+
293
+ .ul--unstyled {
294
+ list-style: none;
295
+ padding: 0;
296
+ }
297
+
298
+ .ul--unstyled > li {
299
+ margin-inline: 0;
300
+ padding: 0;
301
+ }
302
+
303
+ .ul--line-separators > li + li::before {
304
+ border-block-start: 1px solid var(--gray-20);
305
+ content: "";
306
+ display: block;
307
+ margin-block: var(--spacing-layout-half);
308
+ width: 100%;
309
+ }
310
+
311
+ .ul--inline,
312
+ .ul--inline-with-separators,
313
+ .ul--inline-with-line-separators {
314
+ display: inline;
315
+ list-style: none;
316
+ padding-inline: 0 !important;
317
+ padding-left: 0 !important;
318
+ }
319
+
320
+ .ul--inline > li,
321
+ .ul--inline-with-separators > li,
322
+ .ul--inline-with-line-separators > li {
323
+ display: inline-block;
324
+ margin-inline-end: var(--spacing-component-3);
325
+ padding: 0 !important;
326
+ }
327
+
328
+ .ul--inline li:last-child,
329
+ .ul--inline-with-separators li:last-child,
330
+ .ul--inline-with-line-separators li:last-child {
331
+ margin-inline-end: 0;
332
+ }
333
+
334
+ .ul--inline > li + li,
335
+ .ul--inline-with-separators > li + li,
336
+ .ul--inline-with-line-separators > li + li {
337
+ margin-block-start: 0;
338
+ }
339
+
340
+ .ul--inline-with-separators li,
341
+ .ul--inline-with-line-separators li {
342
+ margin-inline-end: 0;
343
+ }
344
+
345
+ .ul--inline-with-separators > li::after {
346
+ content: "•";
347
+ margin-inline: var(--spacing-component-2);
348
+ opacity: 0.5;
349
+ }
350
+
351
+ .ul--inline-with-separators > li:last-child::after {
352
+ content: "";
353
+ }
354
+
355
+ .ul--inline-with-line-separators > li::after {
356
+ content: "|";
357
+ margin-inline: var(--spacing-component-2);
358
+ opacity: 0.5;
359
+ }
360
+
361
+ .ul--inline-with-line-separators > li:last-child::after {
362
+ content: "";
363
+ }
364
+
365
+ // ===
366
+
367
+ // Horizontal rule
368
+
369
+ hr {
370
+ --color: currentColor;
371
+
372
+ background-color: var(--color);
373
+ border: 0;
374
+ color: var(--color);
375
+ display: block;
376
+ font-size: 0;
377
+ height: var(--hairline);
378
+ margin-block: var(--spacing-layout-1);
379
+ opacity: 0.4;
380
+ }
381
+
382
+ // ===
383
+
384
+ // Icons
385
+
386
+ .icon {
387
+ -webkit-font-feature-settings: 'liga';
388
+ direction: ltr;
389
+ display: inline-block;
390
+ font-family: 'Material Symbols Rounded';
391
+ font-feature-settings: 'liga';
392
+ font-size: 1.4em;
393
+ font-style: normal;
394
+ font-weight: normal;
395
+ letter-spacing: normal;
396
+ text-transform: none;
397
+ vertical-align: middle;
398
+ white-space: nowrap;
399
+ word-wrap: normal;
400
+ }
401
+ `;
@@ -0,0 +1,15 @@
1
+ @use './core/reset';
2
+ @use './core/tokens';
3
+ @use './core/base';
4
+ @use './core/grid';
5
+ @use './core/layout';
6
+ @use './core/typography';
7
+ @use './core/helpers';
8
+
9
+ // Include buttons, icons, and form styles
10
+ @use './components/button';
11
+ @use './components/details';
12
+ @use './components/form-elements';
13
+ @use './components/icon';
14
+ @use './components/loader';
15
+ @use './components/link-list';