@codeforamerica/marcomms-design-system 1.19.0 → 1.19.1

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 (91) hide show
  1. package/package.json +2 -1
  2. package/src/components/accordion.js +141 -0
  3. package/src/components/accordion.stories.js +56 -0
  4. package/src/components/avatar.js +62 -0
  5. package/src/components/avatar.stories.js +27 -0
  6. package/src/components/bar.js +102 -0
  7. package/src/components/bar.stories.js +22 -0
  8. package/src/components/blob.js +128 -0
  9. package/src/components/blob.stories.js +73 -0
  10. package/src/components/box.js +55 -0
  11. package/src/components/box.stories.js +24 -0
  12. package/src/components/breadcrumbs.js +80 -0
  13. package/src/components/breadcrumbs.stories.js +27 -0
  14. package/src/components/button.js +163 -0
  15. package/src/components/button.scss +157 -0
  16. package/src/components/button.stories.js +49 -0
  17. package/src/components/callout.js +62 -0
  18. package/src/components/callout.stories.js +20 -0
  19. package/src/components/card.js +456 -0
  20. package/src/components/card.stories.js +227 -0
  21. package/src/components/carousel.js +662 -0
  22. package/src/components/carousel.stories.js +165 -0
  23. package/src/components/details.scss +71 -0
  24. package/src/components/details.stories.js +27 -0
  25. package/src/components/form-elements.scss +304 -0
  26. package/src/components/form-elements.stories.js +134 -0
  27. package/src/components/icon.js +44 -0
  28. package/src/components/icon.scss +32 -0
  29. package/src/components/icon.stories.js +38 -0
  30. package/src/components/label.js +63 -0
  31. package/src/components/label.stories.js +29 -0
  32. package/src/components/link-list.scss +80 -0
  33. package/src/components/link-list.stories.js +52 -0
  34. package/src/components/loader.scss +24 -0
  35. package/src/components/loader.stories.js +12 -0
  36. package/src/components/logo-card.js +93 -0
  37. package/src/components/logo-card.stories.js +48 -0
  38. package/src/components/nav.js +98 -0
  39. package/src/components/nav.stories.js +40 -0
  40. package/src/components/page-nav.js +171 -0
  41. package/src/components/page-nav.stories.js +112 -0
  42. package/src/components/pager.js +98 -0
  43. package/src/components/pager.stories.js +30 -0
  44. package/src/components/pagination.js +116 -0
  45. package/src/components/pagination.stories.js +30 -0
  46. package/src/components/person-card.js +240 -0
  47. package/src/components/person-card.stories.js +58 -0
  48. package/src/components/pill.js +33 -0
  49. package/src/components/pill.stories.js +25 -0
  50. package/src/components/placeholder.js +25 -0
  51. package/src/components/placeholder.stories.js +10 -0
  52. package/src/components/promo.js +82 -0
  53. package/src/components/promo.stories.js +37 -0
  54. package/src/components/pullquote.js +42 -0
  55. package/src/components/pullquote.stories.js +16 -0
  56. package/src/components/quote.js +111 -0
  57. package/src/components/quote.stories.js +23 -0
  58. package/src/components/reveal.js +83 -0
  59. package/src/components/reveal.stories.js +40 -0
  60. package/src/components/slide.js +122 -0
  61. package/src/components/slide.stories.js +49 -0
  62. package/src/components/social-icon.js +236 -0
  63. package/src/components/social-icon.stories.js +36 -0
  64. package/src/components/stat.js +92 -0
  65. package/src/components/stat.stories.js +28 -0
  66. package/src/components/tab-list.js +114 -0
  67. package/src/components/tab-list.stories.js +18 -0
  68. package/src/components/tab.js +95 -0
  69. package/src/components/tab.stories.js +29 -0
  70. package/src/components/tile.js +149 -0
  71. package/src/components/tile.stories.js +41 -0
  72. package/src/components/transcript.js +44 -0
  73. package/src/components/transcript.stories.js +103 -0
  74. package/src/core/base.scss +86 -0
  75. package/src/core/colors.mdx +100 -0
  76. package/src/core/grid.mdx +244 -0
  77. package/src/core/grid.scss +394 -0
  78. package/src/core/helpers.scss +111 -0
  79. package/src/core/layout.scss +103 -0
  80. package/src/core/layout.stories.js +145 -0
  81. package/src/core/reset.scss +53 -0
  82. package/src/core/shadows.mdx +108 -0
  83. package/src/core/tokens.scss +261 -0
  84. package/src/core/typography.mdx +79 -0
  85. package/src/core/typography.scss +411 -0
  86. package/src/core.js +10 -0
  87. package/src/index.js +43 -0
  88. package/src/shared/common.js +65 -0
  89. package/src/shared/layout.js +14 -0
  90. package/src/shared/typography.js +397 -0
  91. package/src/styles.scss +15 -0
@@ -0,0 +1,397 @@
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
+ .prominent-link,
189
+ a.prominent-link {
190
+ --accent-color: var(--purple-60);
191
+
192
+ font-weight: bold;
193
+ text-decoration: underline;
194
+ text-decoration-color: var(--accent-color);
195
+ text-decoration-thickness: var(--medium);
196
+ text-underline-offset: 0.4em;
197
+ transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
198
+
199
+ &:hover {
200
+ --accent-color: var(--red-60);
201
+ }
202
+
203
+ &:not(:has(cfa-icon))::after {
204
+ @include icon.icon;
205
+
206
+ content: "arrow_right_alt";
207
+ display: inline-block;
208
+ padding-inline-start: 0.1em;
209
+ text-decoration: none;
210
+ transition: padding 0.2s ease-in-out;
211
+ width: 1em;
212
+ }
213
+
214
+ &:not(:has(cfa-icon)):hover::after {
215
+ padding-inline-start: 0.3em;
216
+ }
217
+
218
+ cfa-icon {
219
+ text-decoration: none;
220
+ }
221
+ }
222
+
223
+ .white-text,
224
+ .text-light /* fallback */ {
225
+ -moz-osx-font-smoothing: grayscale; // Sharper antialising for white text on a dark background
226
+ -webkit-font-smoothing: antialiased; // Sharper antialising for white text on a dark background
227
+ color: var(--white);
228
+ --link-color: var(--white);
229
+ --link-hover-color: var(--white);
230
+ }
231
+
232
+ // =====
233
+
234
+ // Highlights
235
+
236
+ .highlight {
237
+ --highlight-offset: 0.2em;
238
+
239
+ box-decoration-break: clone;
240
+ display: inline;
241
+ 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%);
242
+ padding-inline: 0.1em;
243
+ -webkit-box-decoration-break: clone;
244
+ margin-inline-start: -0.1em;
245
+ margin-inline-end: -0.1em;
246
+ word-wrap: break-word;
247
+ }
248
+
249
+ // ======
250
+
251
+ // Lists
252
+
253
+ .ul {
254
+ list-style-type: disc;
255
+ padding-left: var(--spacing-layout-1);
256
+ }
257
+
258
+ .ul > li {
259
+ margin-inline-start: 0;
260
+ padding-left: var(--spacing-component-2);
261
+ }
262
+
263
+ .ul > li + li {
264
+ margin-block-start: var(--spacing-layout-half);
265
+ }
266
+
267
+ .ul > li > ul {
268
+ margin-block-start: var(--spacing-layout-half);
269
+ }
270
+
271
+ .ol {
272
+ list-style-type: decimal;
273
+ padding-left: var(--spacing-layout-1);
274
+ }
275
+
276
+ .ol > li {
277
+ margin-inline-start: 0;
278
+ padding-inline-start: var(--spacing-component-2);
279
+ }
280
+
281
+ .ol > li + li {
282
+ margin-block-start: var(--spacing-layout-half);
283
+ }
284
+
285
+ .ol > li > ul {
286
+ margin-block-start: var(--spacing-layout-half);
287
+ }
288
+
289
+ .ul--unstyled {
290
+ list-style: none;
291
+ padding: 0;
292
+ }
293
+
294
+ .ul--unstyled > li {
295
+ margin-inline: 0;
296
+ padding: 0;
297
+ }
298
+
299
+ .ul--line-separators > li + li::before {
300
+ border-block-start: 1px solid var(--gray-20);
301
+ content: "";
302
+ display: block;
303
+ margin-block: var(--spacing-layout-half);
304
+ width: 100%;
305
+ }
306
+
307
+ .ul--inline,
308
+ .ul--inline-with-separators,
309
+ .ul--inline-with-line-separators {
310
+ display: inline;
311
+ list-style: none;
312
+ padding-inline: 0 !important;
313
+ padding-left: 0 !important;
314
+ }
315
+
316
+ .ul--inline > li,
317
+ .ul--inline-with-separators > li,
318
+ .ul--inline-with-line-separators > li {
319
+ display: inline-block;
320
+ margin-inline-end: var(--spacing-component-3);
321
+ padding: 0 !important;
322
+ }
323
+
324
+ .ul--inline li:last-child,
325
+ .ul--inline-with-separators li:last-child,
326
+ .ul--inline-with-line-separators li:last-child {
327
+ margin-inline-end: 0;
328
+ }
329
+
330
+ .ul--inline > li + li,
331
+ .ul--inline-with-separators > li + li,
332
+ .ul--inline-with-line-separators > li + li {
333
+ margin-block-start: 0;
334
+ }
335
+
336
+ .ul--inline-with-separators li,
337
+ .ul--inline-with-line-separators li {
338
+ margin-inline-end: 0;
339
+ }
340
+
341
+ .ul--inline-with-separators > li::after {
342
+ content: "•";
343
+ margin-inline: var(--spacing-component-2);
344
+ opacity: 0.5;
345
+ }
346
+
347
+ .ul--inline-with-separators > li:last-child::after {
348
+ content: "";
349
+ }
350
+
351
+ .ul--inline-with-line-separators > li::after {
352
+ content: "|";
353
+ margin-inline: var(--spacing-component-2);
354
+ opacity: 0.5;
355
+ }
356
+
357
+ .ul--inline-with-line-separators > li:last-child::after {
358
+ content: "";
359
+ }
360
+
361
+ // ===
362
+
363
+ // Horizontal rule
364
+
365
+ hr {
366
+ --color: currentColor;
367
+
368
+ background-color: var(--color);
369
+ border: 0;
370
+ color: var(--color);
371
+ display: block;
372
+ font-size: 0;
373
+ height: var(--hairline);
374
+ margin-block: var(--spacing-layout-1);
375
+ opacity: 0.4;
376
+ }
377
+
378
+ // ===
379
+
380
+ // Icons
381
+
382
+ .icon {
383
+ -webkit-font-feature-settings: 'liga';
384
+ direction: ltr;
385
+ display: inline-block;
386
+ font-family: 'Material Symbols Rounded';
387
+ font-feature-settings: 'liga';
388
+ font-size: 1.4em;
389
+ font-style: normal;
390
+ font-weight: normal;
391
+ letter-spacing: normal;
392
+ text-transform: none;
393
+ vertical-align: middle;
394
+ white-space: nowrap;
395
+ word-wrap: normal;
396
+ }
397
+ `;
@@ -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';