@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.
- package/package.json +2 -1
- package/src/components/accordion.js +141 -0
- package/src/components/accordion.stories.js +56 -0
- package/src/components/avatar.js +62 -0
- package/src/components/avatar.stories.js +27 -0
- package/src/components/bar.js +102 -0
- package/src/components/bar.stories.js +22 -0
- package/src/components/blob.js +128 -0
- package/src/components/blob.stories.js +73 -0
- package/src/components/box.js +55 -0
- package/src/components/box.stories.js +24 -0
- package/src/components/breadcrumbs.js +80 -0
- package/src/components/breadcrumbs.stories.js +27 -0
- package/src/components/button.js +163 -0
- package/src/components/button.scss +157 -0
- package/src/components/button.stories.js +49 -0
- package/src/components/callout.js +62 -0
- package/src/components/callout.stories.js +20 -0
- package/src/components/card.js +456 -0
- package/src/components/card.stories.js +227 -0
- package/src/components/carousel.js +662 -0
- package/src/components/carousel.stories.js +165 -0
- package/src/components/details.scss +71 -0
- package/src/components/details.stories.js +27 -0
- package/src/components/form-elements.scss +304 -0
- package/src/components/form-elements.stories.js +134 -0
- package/src/components/icon.js +44 -0
- package/src/components/icon.scss +32 -0
- package/src/components/icon.stories.js +38 -0
- package/src/components/label.js +63 -0
- package/src/components/label.stories.js +29 -0
- package/src/components/link-list.scss +80 -0
- package/src/components/link-list.stories.js +52 -0
- package/src/components/loader.scss +24 -0
- package/src/components/loader.stories.js +12 -0
- package/src/components/logo-card.js +93 -0
- package/src/components/logo-card.stories.js +48 -0
- package/src/components/nav.js +98 -0
- package/src/components/nav.stories.js +40 -0
- package/src/components/page-nav.js +171 -0
- package/src/components/page-nav.stories.js +112 -0
- package/src/components/pager.js +98 -0
- package/src/components/pager.stories.js +30 -0
- package/src/components/pagination.js +116 -0
- package/src/components/pagination.stories.js +30 -0
- package/src/components/person-card.js +240 -0
- package/src/components/person-card.stories.js +58 -0
- package/src/components/pill.js +33 -0
- package/src/components/pill.stories.js +25 -0
- package/src/components/placeholder.js +25 -0
- package/src/components/placeholder.stories.js +10 -0
- package/src/components/promo.js +82 -0
- package/src/components/promo.stories.js +37 -0
- package/src/components/pullquote.js +42 -0
- package/src/components/pullquote.stories.js +16 -0
- package/src/components/quote.js +111 -0
- package/src/components/quote.stories.js +23 -0
- package/src/components/reveal.js +83 -0
- package/src/components/reveal.stories.js +40 -0
- package/src/components/slide.js +122 -0
- package/src/components/slide.stories.js +49 -0
- package/src/components/social-icon.js +236 -0
- package/src/components/social-icon.stories.js +36 -0
- package/src/components/stat.js +92 -0
- package/src/components/stat.stories.js +28 -0
- package/src/components/tab-list.js +114 -0
- package/src/components/tab-list.stories.js +18 -0
- package/src/components/tab.js +95 -0
- package/src/components/tab.stories.js +29 -0
- package/src/components/tile.js +149 -0
- package/src/components/tile.stories.js +41 -0
- package/src/components/transcript.js +44 -0
- package/src/components/transcript.stories.js +103 -0
- package/src/core/base.scss +86 -0
- package/src/core/colors.mdx +100 -0
- package/src/core/grid.mdx +244 -0
- package/src/core/grid.scss +394 -0
- package/src/core/helpers.scss +111 -0
- package/src/core/layout.scss +103 -0
- package/src/core/layout.stories.js +145 -0
- package/src/core/reset.scss +53 -0
- package/src/core/shadows.mdx +108 -0
- package/src/core/tokens.scss +261 -0
- package/src/core/typography.mdx +79 -0
- package/src/core/typography.scss +411 -0
- package/src/core.js +10 -0
- package/src/index.js +43 -0
- package/src/shared/common.js +65 -0
- package/src/shared/layout.js +14 -0
- package/src/shared/typography.js +397 -0
- package/src/styles.scss +15 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { html } from "lit-html";
|
|
2
|
+
import "../components/card";
|
|
3
|
+
import "../components/quote";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Core/Layout",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Default = () => html`
|
|
10
|
+
<div>
|
|
11
|
+
<div class="container-fluid container-fluid--grid-test wrapper stack">
|
|
12
|
+
<div class="row">
|
|
13
|
+
<div class="col-xs-12 col-md-8">
|
|
14
|
+
<div>
|
|
15
|
+
<h1 class="eyebrow">Tax Benefits</h1>
|
|
16
|
+
<p class="display-1">Making tax filing simple, free, and accessible for all</p>
|
|
17
|
+
<p class="display-2">As much as $15 billion in federal tax benefits goes unclaimed every year.</p>
|
|
18
|
+
<p>
|
|
19
|
+
Ultimately, this is the result of a status quo that requires millions of Americans to spend time and money they don’t have to fulfill the prerequisite for receiving benefits: filing a tax return. Tax benefits are some of the largest, most effective anti-poverty tools in the United States, but under our current system, too many people miss out on the support they need.
|
|
20
|
+
</p>
|
|
21
|
+
<p class="h1">For too long, the status quo has been a tax filing system that stands in the way of getting flexible cash from tax benefits into people’s hands.</p>
|
|
22
|
+
<p>
|
|
23
|
+
Aside from the lucky few able to access nonprofit tax prep like the Volunteer Income Tax Assistance (VITA) Program, the system gives most people two options:
|
|
24
|
+
</p>
|
|
25
|
+
<ul>
|
|
26
|
+
<li>
|
|
27
|
+
Collectively pay billions of dollars each year to file their tax returns via commercial preparers
|
|
28
|
+
</li>
|
|
29
|
+
<li>
|
|
30
|
+
Not file altogether, thus missing out on billions of dollars in tax benefits for which they’re eligible.
|
|
31
|
+
</li>
|
|
32
|
+
</ul>
|
|
33
|
+
<p>
|
|
34
|
+
By streamlining and simplifying the tax filing process, we can help more people file their tax returns for free. Ultimately, simplified tax filing will deliver life-changing cash through tax benefits.
|
|
35
|
+
</p>
|
|
36
|
+
<hr>
|
|
37
|
+
<p>
|
|
38
|
+
Tax benefits are some of the largest, most effective anti-poverty tools in the United States, but under our current system, too many people miss out on the support they need.
|
|
39
|
+
</p>
|
|
40
|
+
<h2>What is flexible cash? Flexible cash—meaning money that individuals and families decide how to spend for themselves—is one of the best ways to empower people toward financial stability.</h2>
|
|
41
|
+
<p>
|
|
42
|
+
Flexible cash—meaning money that individuals and families decide how to spend for themselves—is one of the best ways to empower people toward financial stability.
|
|
43
|
+
</p>
|
|
44
|
+
<p class="small">
|
|
45
|
+
Cash support helps people provide for their basic needs, find and keep living wage jobs, and handle emergencies as they arise. Flexible cash has been distributed through the tax system via tax credits and stimulus payments.
|
|
46
|
+
</p>
|
|
47
|
+
<h3>We believe in government providing free and easy tax filing services.</h3>
|
|
48
|
+
<p>
|
|
49
|
+
Through the mindful use of technology, Code for America works to ensure all who are eligible for benefits distributed through the tax system actually can claim and receive them.
|
|
50
|
+
</p>
|
|
51
|
+
<p class="eyebrow-with-line">Our Approach</p>
|
|
52
|
+
<p class="large">
|
|
53
|
+
We believe in government providing free and easy tax filing services. To advance that goal, we build products that show what’s possible and enable government to deliver these simplified tax filing services.
|
|
54
|
+
</p>
|
|
55
|
+
<p>
|
|
56
|
+
In 2021, we launched GetCTC.
|
|
57
|
+
</p>
|
|
58
|
+
<p class="extra-large">
|
|
59
|
+
It's a free, easy tax filing tool that allowed 200,000 families to claim key tax benefits like the stimulus and expanded Child Tax Credit during the COVID-19 pandemic.
|
|
60
|
+
</p>
|
|
61
|
+
<p>
|
|
62
|
+
This helped spark a national movement to use government technology to advance access to tax benefits for families with low income—a movement that ultimately set the foundation for a historic new simplified filing tool: IRS Direct File.
|
|
63
|
+
</p>
|
|
64
|
+
<cfa-quote>
|
|
65
|
+
IRS Direct File is a game changer for families with low income. It simplifies the tax filing process and ensures everyone can access the benefits they deserve.
|
|
66
|
+
<span slot="attribution">Amanda Renteria, CEO, Code for America</span>
|
|
67
|
+
</cfa-quote>
|
|
68
|
+
<p>
|
|
69
|
+
The impact of these technological innovations extends far beyond individual tax returns. By demonstrating what's possible when government prioritizes user experience and accessibility, we're helping to reshape expectations around public services. Our work shows that with the right approach, government can deliver digital services that are not only functional but genuinely helpful to the people who need them most.
|
|
70
|
+
</p>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="col-xs-12 col-md-4 stack">
|
|
74
|
+
<div>
|
|
75
|
+
<p>
|
|
76
|
+
It's a free, easy tax filing tool that allowed 200,000 families to claim key tax benefits like the stimulus and expanded Child Tax Credit during the COVID-19 pandemic.
|
|
77
|
+
</p>
|
|
78
|
+
<cfa-quote>
|
|
79
|
+
IRS Direct File is a game changer for families with low income. It simplifies the tax filing process and ensures everyone can access the benefits they deserve.
|
|
80
|
+
<span slot="attribution">Amanda Renteria, CEO, Code for America</span>
|
|
81
|
+
</cfa-quote>
|
|
82
|
+
<p>
|
|
83
|
+
We believe in government providing free and easy tax filing services. To advance that goal, we build products that show what’s possible and enable government to deliver these simplified tax filing services. Code for America works to ensure all who are eligible for benefits distributed through the tax system actually can claim and receive them.
|
|
84
|
+
</p>
|
|
85
|
+
</div>
|
|
86
|
+
<cfa-card
|
|
87
|
+
eyebrow="Featured Program"
|
|
88
|
+
title="GetCTC Tool"
|
|
89
|
+
text="A free, easy tax filing tool that helped 200,000 families claim key tax benefits during the COVID-19 pandemic."
|
|
90
|
+
actionLabel="Learn more"
|
|
91
|
+
></cfa-card>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
<div clasS="row center-md">
|
|
95
|
+
<div class="col-xs-12">
|
|
96
|
+
<div class="grid">
|
|
97
|
+
<cfa-card
|
|
98
|
+
eyebrow="Impact"
|
|
99
|
+
title="Direct File Success"
|
|
100
|
+
text="IRS Direct File launched as a simplified filing tool, building on our GetCTC foundation to serve millions more families."
|
|
101
|
+
actionLabel="Read story"
|
|
102
|
+
></cfa-card>
|
|
103
|
+
<cfa-card
|
|
104
|
+
eyebrow="Research"
|
|
105
|
+
title="Tax Benefits Access"
|
|
106
|
+
text="$15 billion in federal tax benefits goes unclaimed every year due to complex filing requirements."
|
|
107
|
+
actionLabel="View data"
|
|
108
|
+
></cfa-card>
|
|
109
|
+
<cfa-card
|
|
110
|
+
eyebrow="Solution"
|
|
111
|
+
title="Free Tax Filing"
|
|
112
|
+
text="Government should provide free and easy tax filing services to ensure everyone can access their benefits."
|
|
113
|
+
actionLabel="Our approach"
|
|
114
|
+
></cfa-card>
|
|
115
|
+
<cfa-card
|
|
116
|
+
eyebrow="Community"
|
|
117
|
+
title="VITA Program"
|
|
118
|
+
text="Volunteer Income Tax Assistance provides free tax prep, but serves only a small portion of those in need."
|
|
119
|
+
actionLabel="Find location"
|
|
120
|
+
></cfa-card>
|
|
121
|
+
<cfa-card
|
|
122
|
+
eyebrow="Technology"
|
|
123
|
+
title="Simplified Filing"
|
|
124
|
+
text="Through mindful use of technology, we work to ensure all eligible families can claim and receive their tax benefits."
|
|
125
|
+
actionLabel="See how"
|
|
126
|
+
></cfa-card>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
<div clasS="row center-md">
|
|
131
|
+
<div class="col-xs-12">
|
|
132
|
+
<h2 class="eyebrow text-center">Case Studies</h2>
|
|
133
|
+
<div class="grid">
|
|
134
|
+
<cfa-card
|
|
135
|
+
eyebrow="Case Study"
|
|
136
|
+
title="Flexible Cash Impact"
|
|
137
|
+
text="Cash support helps people provide for basic needs, find living wage jobs, and handle emergencies. Learn how flexible cash distributed through tax credits creates lasting financial stability."
|
|
138
|
+
actionLabel="Read case study"
|
|
139
|
+
></cfa-card>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
`;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Use a more-intuitive box-sizing model.
|
|
2
|
+
*, *::before, *::after {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// Remove default margin
|
|
7
|
+
* {
|
|
8
|
+
margin: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Set default text-wrap of 'pretty'
|
|
12
|
+
* {
|
|
13
|
+
text-wrap: pretty;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Wrap overly long words
|
|
17
|
+
* {
|
|
18
|
+
overflow-wrap: break-word;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
word-break: break-word;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Fix Safari antialiasing for variable fonts
|
|
24
|
+
* {
|
|
25
|
+
font-synthesis: none !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Improve text rendering
|
|
29
|
+
body {
|
|
30
|
+
-webkit-font-smoothing: antialiased;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Reasonable media defaults
|
|
34
|
+
img, picture, video, canvas, svg {
|
|
35
|
+
display: block;
|
|
36
|
+
height: auto;
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Remove built-in form typography styles
|
|
41
|
+
input, button, textarea, select {
|
|
42
|
+
font: inherit;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Avoid text overflows
|
|
46
|
+
p, h1, h2, h3, h4, h5, h6 {
|
|
47
|
+
overflow-wrap: break-word;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Create a root stacking context
|
|
51
|
+
#root, #__next {
|
|
52
|
+
isolation: isolate;
|
|
53
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="Core/Shadows" />
|
|
4
|
+
|
|
5
|
+
<style>
|
|
6
|
+
{`
|
|
7
|
+
.shadow-samples {
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
10
|
+
gap: 2rem;
|
|
11
|
+
padding: 2rem;
|
|
12
|
+
background-color: var(--gray-20);
|
|
13
|
+
border-radius: var(--rounded-corners);
|
|
14
|
+
margin: 2rem 0;
|
|
15
|
+
}
|
|
16
|
+
.shadow-sample {
|
|
17
|
+
width: 200px;
|
|
18
|
+
height: 120px;
|
|
19
|
+
background-color: var(--white);
|
|
20
|
+
border-radius: var(--rounded-corners);
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
font-weight: bold;
|
|
25
|
+
margin-bottom: 1rem;
|
|
26
|
+
}
|
|
27
|
+
.shadow-none {
|
|
28
|
+
box-shadow: none;
|
|
29
|
+
border: 1px solid var(--gray-40);
|
|
30
|
+
}
|
|
31
|
+
.shadow-small {
|
|
32
|
+
box-shadow: var(--shadow-small);
|
|
33
|
+
}
|
|
34
|
+
.shadow-medium {
|
|
35
|
+
box-shadow: var(--shadow-medium);
|
|
36
|
+
}
|
|
37
|
+
.shadow-large {
|
|
38
|
+
box-shadow: var(--shadow-large);
|
|
39
|
+
}
|
|
40
|
+
.shadow-description {
|
|
41
|
+
margin: 0;
|
|
42
|
+
font-size: 0.875rem;
|
|
43
|
+
color: var(--gray-60);
|
|
44
|
+
}
|
|
45
|
+
.css-variables {
|
|
46
|
+
font-family: monospace;
|
|
47
|
+
background-color: var(--gray-20);
|
|
48
|
+
padding: 1rem;
|
|
49
|
+
border-radius: var(--rounded-corners);
|
|
50
|
+
margin: 1rem 0;
|
|
51
|
+
}
|
|
52
|
+
.code-example {
|
|
53
|
+
background-color: var(--gray-20);
|
|
54
|
+
padding: 1rem;
|
|
55
|
+
border-radius: var(--rounded-corners);
|
|
56
|
+
overflow-x: auto;
|
|
57
|
+
margin: 1rem 0;
|
|
58
|
+
}
|
|
59
|
+
`}
|
|
60
|
+
</style>
|
|
61
|
+
|
|
62
|
+
# Shadows
|
|
63
|
+
|
|
64
|
+
Shadow tokens provide elevation and depth to components and elements.
|
|
65
|
+
|
|
66
|
+
## Shadow Levels
|
|
67
|
+
|
|
68
|
+
<div className="shadow-samples">
|
|
69
|
+
<div>
|
|
70
|
+
<div className="shadow-sample shadow-small">
|
|
71
|
+
Small Shadow
|
|
72
|
+
</div>
|
|
73
|
+
<p className="shadow-description">
|
|
74
|
+
Use for subtle elevation, like buttons and form elements.
|
|
75
|
+
</p>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div>
|
|
79
|
+
<div className="shadow-sample shadow-medium">
|
|
80
|
+
Medium Shadow
|
|
81
|
+
</div>
|
|
82
|
+
<p className="shadow-description">
|
|
83
|
+
Use for cards, modals, and other elevated content areas.
|
|
84
|
+
</p>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div>
|
|
88
|
+
<div className="shadow-sample shadow-large">
|
|
89
|
+
Large Shadow
|
|
90
|
+
</div>
|
|
91
|
+
<p className="shadow-description">
|
|
92
|
+
Use for high-priority elements like dialogs and overlays.
|
|
93
|
+
</p>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
## CSS Variables
|
|
98
|
+
|
|
99
|
+
Use these CSS custom properties in your stylesheets:
|
|
100
|
+
|
|
101
|
+
<div className="css-variables">
|
|
102
|
+
<ul>
|
|
103
|
+
<li><strong>--shadow-small:</strong> Subtle elevation</li>
|
|
104
|
+
<li><strong>--shadow-medium:</strong> Standard elevation</li>
|
|
105
|
+
<li><strong>--shadow-large:</strong> High elevation</li>
|
|
106
|
+
<li><strong>--shadow-color:</strong> rgba(0,0,0,0.1) - Base shadow color</li>
|
|
107
|
+
</ul>
|
|
108
|
+
</div>
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
@use 'grid';
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
|
|
5
|
+
// Color
|
|
6
|
+
|
|
7
|
+
--black: #000;
|
|
8
|
+
--white: #fff;
|
|
9
|
+
|
|
10
|
+
--black-10: rgba(0,0,0,0.1);
|
|
11
|
+
--black-20: rgba(0,0,0,0.2);
|
|
12
|
+
--black-40: rgba(0,0,0,0.4);
|
|
13
|
+
--black-60: rgba(0,0,0,0.6);
|
|
14
|
+
--black-80: rgba(0,0,0,0.8);
|
|
15
|
+
|
|
16
|
+
--white-20: rgba(255,255,255,0.2);
|
|
17
|
+
--white-40: rgba(255,255,255,0.4);
|
|
18
|
+
--white-60: rgba(255,255,255,0.6);
|
|
19
|
+
--white-80: rgba(255,255,255,0.8);
|
|
20
|
+
|
|
21
|
+
--gray-20: #ececec;
|
|
22
|
+
--gray-40: #b4b4b4;
|
|
23
|
+
--gray-60: #555555;
|
|
24
|
+
--gray-80: #292929;
|
|
25
|
+
|
|
26
|
+
--purple-10: #f4f4fb;
|
|
27
|
+
--purple-20: #DBDAF1;
|
|
28
|
+
--purple-40: #ADA9FF;
|
|
29
|
+
--purple-60: #4B49B2;
|
|
30
|
+
--purple-80: #2B1A78;
|
|
31
|
+
|
|
32
|
+
--red-20: #FBDADC;
|
|
33
|
+
--red-40: #FF999F;
|
|
34
|
+
--red-60: #AF121D;
|
|
35
|
+
--red-80: #5C0A0F;
|
|
36
|
+
|
|
37
|
+
--blue-20: #E6EBF9;
|
|
38
|
+
--blue-40: #B3C7FF;
|
|
39
|
+
--blue-60: #7595F0;
|
|
40
|
+
--blue-80: #172C68;
|
|
41
|
+
|
|
42
|
+
--yellow-20: #FFEBCC;
|
|
43
|
+
--yellow-40: #FFD699;
|
|
44
|
+
--yellow-60: #F2AA40;
|
|
45
|
+
--yellow-80: #663D00;
|
|
46
|
+
|
|
47
|
+
--green-20: #D6F5ED;
|
|
48
|
+
--green-40: #ADF0E0;
|
|
49
|
+
--green-60: #39AA8E;
|
|
50
|
+
--green-80: #004239;
|
|
51
|
+
|
|
52
|
+
--sand-20: #F5F0ED;
|
|
53
|
+
--sand-40: #F8D5BF;
|
|
54
|
+
--sand-60: #C19F8B;
|
|
55
|
+
--sand-80: #3D3129;
|
|
56
|
+
|
|
57
|
+
--brand-purple: var(--purple-80);
|
|
58
|
+
--brand-red: var(--red-60);
|
|
59
|
+
|
|
60
|
+
--accent-color: var(--purple-60);
|
|
61
|
+
|
|
62
|
+
--text-color: var(--black);
|
|
63
|
+
|
|
64
|
+
--base-link-color: var(--purple-80);
|
|
65
|
+
--base-link-hover-color: var(--red-60);
|
|
66
|
+
|
|
67
|
+
--link-color: var(--base-link-color);
|
|
68
|
+
--link-hover-color: var(--base-link-hover-color);
|
|
69
|
+
|
|
70
|
+
// =====
|
|
71
|
+
|
|
72
|
+
// Spacing
|
|
73
|
+
|
|
74
|
+
/* Layout spacing (based on REM) */
|
|
75
|
+
|
|
76
|
+
--spacing-layout-0: 0;
|
|
77
|
+
--spacing-layout-half: 0.75rem;
|
|
78
|
+
--spacing-layout-1: 1.5rem;
|
|
79
|
+
--spacing-layout-2: 3rem;
|
|
80
|
+
--spacing-layout-3: 4.5rem;
|
|
81
|
+
--spacing-layout-4: 6rem;
|
|
82
|
+
--spacing-layout-5: 7.5rem;
|
|
83
|
+
--spacing-layout-6: 9rem;
|
|
84
|
+
--spacing-layout-7: 10.5rem;
|
|
85
|
+
--spacing-layout-8: 12rem;
|
|
86
|
+
--spacing-layout-9: 13.5rem;
|
|
87
|
+
|
|
88
|
+
/* Component spacing (based on fractions of layout spacing) */
|
|
89
|
+
|
|
90
|
+
--spacing-component-0: 0;
|
|
91
|
+
--spacing-component-1: calc(0.125 * var(--spacing-layout-1));
|
|
92
|
+
--spacing-component-2: calc(0.25 * var(--spacing-layout-1));
|
|
93
|
+
--spacing-component-3: calc(0.5 * var(--spacing-layout-1));
|
|
94
|
+
--spacing-component-4: calc(1 * var(--spacing-layout-1));
|
|
95
|
+
--spacing-component-5: calc(2 * var(--spacing-layout-1));
|
|
96
|
+
--spacing-component-6: calc(4 * var(--spacing-layout-1));
|
|
97
|
+
--spacing-component-7: calc(8 * var(--spacing-layout-1));
|
|
98
|
+
--spacing-component-8: calc(16 * var(--spacing-layout-1));
|
|
99
|
+
--spacing-component-9: calc(32 * var(--spacing-layout-1));
|
|
100
|
+
|
|
101
|
+
// =====
|
|
102
|
+
|
|
103
|
+
// Layout and grid
|
|
104
|
+
|
|
105
|
+
/* Breakpoints */
|
|
106
|
+
|
|
107
|
+
--breakpoint-mobile: 480px;
|
|
108
|
+
--breakpoint-tablet: 768px;
|
|
109
|
+
--breakpoint-desktop: 1024px;
|
|
110
|
+
--breakpoint-widescreen: 1600px;
|
|
111
|
+
|
|
112
|
+
/* Layout */
|
|
113
|
+
|
|
114
|
+
--gutter-width: var(--spacing-layout-1);
|
|
115
|
+
--outer-margin: var(--spacing-layout-1);
|
|
116
|
+
--grid-max-width: 1200px;
|
|
117
|
+
--grid-max-width-wp: calc(var(--grid-max-width) - var(--outer-margin) * 2);
|
|
118
|
+
|
|
119
|
+
/* Column sizes */
|
|
120
|
+
|
|
121
|
+
@for $i from 1 through 12 {
|
|
122
|
+
--column-span-#{$i}: #{grid.column-span($i)};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// =====
|
|
126
|
+
|
|
127
|
+
// Typography
|
|
128
|
+
|
|
129
|
+
--font-family-serif: 'Source Serif 4', serif;
|
|
130
|
+
--font-family-sans-serif: 'Source Sans 3', sans-serif;
|
|
131
|
+
|
|
132
|
+
--font-family-base: var(--font-family-sans-serif);
|
|
133
|
+
--font-family-heading: var(--font-family-serif);
|
|
134
|
+
--font-family-display-1: var(--font-family-heading);
|
|
135
|
+
--font-family-display-2: var(--font-family-heading);
|
|
136
|
+
--font-family-h1: var(--font-family-heading);
|
|
137
|
+
--font-family-h2: var(--font-family-heading);
|
|
138
|
+
--font-family-h3: var(--font-family-heading);
|
|
139
|
+
--font-family-h4: var(--font-family-heading);
|
|
140
|
+
--font-family-eyebrow: var(--base-font-family);
|
|
141
|
+
|
|
142
|
+
--font-size-base: 20px;
|
|
143
|
+
--font-size-display-1: 3.052rem; // 61.04px
|
|
144
|
+
--font-size-display-2: 2.441rem; // 48.83px
|
|
145
|
+
--font-size-h1: 1.953rem; // 39.06px
|
|
146
|
+
--font-size-h2: 1.563rem; // 31.25px
|
|
147
|
+
--font-size-h3: 1.25rem; // 25px
|
|
148
|
+
--font-size-h4: 1rem; // 20px
|
|
149
|
+
--font-size-eyebrow: 0.7rem; // 16px
|
|
150
|
+
--font-size-extra-large: var(--font-size-h2);
|
|
151
|
+
--font-size-large: var(--font-size-h3);
|
|
152
|
+
--font-size-small: 0.8rem;
|
|
153
|
+
|
|
154
|
+
--font-weight-regular: 400;
|
|
155
|
+
--font-weight-bold: 700;
|
|
156
|
+
--font-weight-display-1: var(--font-weight-bold);
|
|
157
|
+
--font-weight-display-2: var(--font-weight-bold);
|
|
158
|
+
--font-weight-h1: var(--font-weight-bold);
|
|
159
|
+
--font-weight-h2: var(--font-weight-bold);
|
|
160
|
+
--font-weight-h3: var(--font-weight-bold);
|
|
161
|
+
--font-weight-h4: var(--font-weight-bold);
|
|
162
|
+
--font-weight-eyebrow: var(--font-weight-bold);
|
|
163
|
+
|
|
164
|
+
--line-height-base: var(--spacing-layout-1);
|
|
165
|
+
--line-height-display-1: calc(2 * var(--line-height-base));
|
|
166
|
+
--line-height-display-2: calc(2 * var(--line-height-base));
|
|
167
|
+
--line-height-h1: calc(1.5 * var(--line-height-base));
|
|
168
|
+
--line-height-h2: calc(1.5 * var(--line-height-base));
|
|
169
|
+
--line-height-h3: calc(1 * var(--line-height-base));
|
|
170
|
+
--line-height-h4: calc(1 * var(--line-height-base));
|
|
171
|
+
--line-height-eyebrow: calc(1 * var(--line-height-base));
|
|
172
|
+
--line-height-extra-large: calc(1.5 * var(--line-height-base));
|
|
173
|
+
--line-height-large: calc(1 * var(--line-height-base));
|
|
174
|
+
--line-height-small: calc(0.75 * var(--line-height-base));
|
|
175
|
+
|
|
176
|
+
// Line height aliases
|
|
177
|
+
--line-height-sm: var(--line-height-small);
|
|
178
|
+
--line-height-md: var(--line-height-base);
|
|
179
|
+
--line-height-lg: var(--line-height-large);
|
|
180
|
+
--line-height-xl: var(--line-height-extra-large);
|
|
181
|
+
--line-height-xxl: var(--line-height-display-2);
|
|
182
|
+
--line-height-xxxl: var(--line-height-display-1);
|
|
183
|
+
|
|
184
|
+
--letter-spacing-base: normal;
|
|
185
|
+
--letter-spacing-display-1: normal;
|
|
186
|
+
--letter-spacing-display-2: normal;
|
|
187
|
+
--letter-spacing-h1: normal;
|
|
188
|
+
--letter-spacing-h2: normal;
|
|
189
|
+
--letter-spacing-h3: normal;
|
|
190
|
+
--letter-spacing-h4: normal;
|
|
191
|
+
--letter-spacing-eyebrow: 0.1em;
|
|
192
|
+
--letter-spacing-small: normal;
|
|
193
|
+
|
|
194
|
+
// Letter spacing aliases
|
|
195
|
+
--letter-spacing-sm: var(--letter-spacing-small);
|
|
196
|
+
--letter-spacing-md: var(--letter-spacing-base);
|
|
197
|
+
--letter-spacing-lg: var(--letter-spacing-large);
|
|
198
|
+
--letter-spacing-xl: var(--letter-spacing-extra-large);
|
|
199
|
+
--letter-spacing-xxl: var(--letter-spacing-display-2);
|
|
200
|
+
--letter-spacing-xxxl: var(--letter-spacing-display-1);
|
|
201
|
+
|
|
202
|
+
--text-underline-offset: 0.3em;
|
|
203
|
+
|
|
204
|
+
// Text highlight
|
|
205
|
+
--highlight-color: var(--yellow-40);
|
|
206
|
+
--highlight-thickness: 0.4em;
|
|
207
|
+
|
|
208
|
+
// =====
|
|
209
|
+
|
|
210
|
+
// Borner thicknesses
|
|
211
|
+
|
|
212
|
+
--hairline: 1px;
|
|
213
|
+
--thin: 2px;
|
|
214
|
+
--medium: 4px;
|
|
215
|
+
--thick: 8px;
|
|
216
|
+
|
|
217
|
+
// Focus Outline
|
|
218
|
+
--focus-color: var(--blue-40);
|
|
219
|
+
--focus-outline: var(--medium) solid var(--focus-color);
|
|
220
|
+
|
|
221
|
+
// =====
|
|
222
|
+
|
|
223
|
+
// Border radius
|
|
224
|
+
|
|
225
|
+
--rounded-corners: var(--spacing-component-2);
|
|
226
|
+
|
|
227
|
+
// =====
|
|
228
|
+
|
|
229
|
+
// Shadows
|
|
230
|
+
|
|
231
|
+
--shadow-color: rgba(0,0,0,0.1);
|
|
232
|
+
|
|
233
|
+
--shadow-small:
|
|
234
|
+
0.2px 0.7px 0.8px var(--shadow-color),
|
|
235
|
+
0.9px 3px 3.5px -2.5px var(--shadow-color),
|
|
236
|
+
-2px -2px 2px -2px var(--shadow-color);
|
|
237
|
+
--shadow-medium:
|
|
238
|
+
0.2px 0.7px 0.8px var(--shadow-color),
|
|
239
|
+
1.1px 3.8px 4.5px -1.2px var(--shadow-color),
|
|
240
|
+
4.3px 14.8px 17.3px -2.5px var(--shadow-color),
|
|
241
|
+
-2px -2px 2px -2px var(--shadow-color);
|
|
242
|
+
--shadow-large:
|
|
243
|
+
0.2px 0.7px 0.8px var(--shadow-color),
|
|
244
|
+
2.9px 10px 11.7px -0.8px var(--shadow-color),
|
|
245
|
+
8.6px 30px 35.1px -1.7px var(--shadow-color),
|
|
246
|
+
22.4px 77.8px 91.1px -2.5px var(--shadow-color);
|
|
247
|
+
|
|
248
|
+
// =====
|
|
249
|
+
|
|
250
|
+
// Background blobs
|
|
251
|
+
|
|
252
|
+
--bg-blob-1: url("data:image/svg+xml,%3Csvg width='628' height='577' viewBox='0 0 628 577' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M304.482 3.44206C399.413 -5.50752 504.225 1.17063 567.446 72.5295C633.526 147.115 639.549 256.491 613.992 352.793C589.57 444.814 526.084 523.087 438.164 559.679C355.477 594.092 265.039 570.416 184.315 531.621C103.504 492.784 22.0294 438.546 3.59029 350.826C-14.5863 264.355 39.2746 183.666 97.1329 116.868C151.394 54.223 221.956 11.2221 304.482 3.44206Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
253
|
+
|
|
254
|
+
--bg-blob-2: url("data:image/svg+xml,%3Csvg width='580' height='592' viewBox='0 0 580 592' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M238.814 591.215C210.461 592.077 182.849 587.767 155.66 580.979C60.4457 557.059 4.05766 489.933 0.460672 390.376C-2.50155 306.442 8.71258 223.693 37.2769 144.499C73.2468 44.6185 170.894 -12.5948 276.159 2.81295C358.996 14.9883 437.177 39.3389 499.172 100.108C588.039 187.167 604.437 293.512 544.346 402.767C514.618 456.855 477.59 505.988 426.386 541.544C369.892 580.656 304.723 587.767 238.814 591.215Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
255
|
+
|
|
256
|
+
--bg-blob-3: url("data:image/svg+xml,%3Csvg width='620' height='613' viewBox='0 0 620 613' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M619.142 301.769C615.581 212.393 536.92 153.752 466.654 98.7402C397.998 44.9883 323.934 -10.5844 236.421 2.12929C141.656 15.8965 53.9975 76.8338 15.687 164.256C-20.6955 247.277 16.2818 336.243 54.5575 417.127C92.4807 497.265 137.965 580.831 224.139 604.752C314.166 629.742 409.183 593.817 484.092 536.359C559.738 478.336 622.883 395.641 619.142 301.769Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
257
|
+
|
|
258
|
+
--bg-blob-4: url("data:image/svg+xml,%3Csvg width='656' height='566' viewBox='0 0 656 566' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M332.011 564.695C235.808 569.34 135.091 552.4 71.2946 488.381C4.66596 421.518 -10.0767 327.738 8.2158 239.764C27.3773 147.61 73.5054 52.3693 169.88 14.2546C263.181 -22.6447 364.8 21.5179 455.491 62.8734C540.631 101.698 627.337 150.367 649.771 233.088C672.265 316.032 626.78 399.503 564.43 464.569C505.684 525.875 422.382 560.331 332.011 564.695Z' fill='currentColor'/%3E%3C/svg%3E");
|
|
259
|
+
|
|
260
|
+
--bg-blob: var(--bg-blob-1);
|
|
261
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Meta, Typeset, Unstyled } from '@storybook/addon-docs/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="Core/Typography" />
|
|
4
|
+
|
|
5
|
+
export const typography = {
|
|
6
|
+
type: {
|
|
7
|
+
serif: '"Source Serif 4"',
|
|
8
|
+
"sans-serif": '"Source Sans 3"',
|
|
9
|
+
},
|
|
10
|
+
weight: {
|
|
11
|
+
regular: '400',
|
|
12
|
+
bold: '700',
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
base: 20,
|
|
16
|
+
"display-1": 61,
|
|
17
|
+
"display-2": 49,
|
|
18
|
+
h1: 39,
|
|
19
|
+
h2: 31,
|
|
20
|
+
h3: 25,
|
|
21
|
+
h4: 20,
|
|
22
|
+
small: 16,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const SampleText = 'We’ve been working for more than a decade with governments and communities across the country to break down barriers and find real solutions.';
|
|
27
|
+
|
|
28
|
+
# Typography
|
|
29
|
+
|
|
30
|
+
We use two font families on the Code for America website: **{typography.type.serif}** and **{typography.type["sans-serif"]}**. Our base font size is `20px` and our typography uses a _major third_ type scale.
|
|
31
|
+
|
|
32
|
+
## Headings
|
|
33
|
+
|
|
34
|
+
Headings are set in **{typography.type.serif}**.
|
|
35
|
+
|
|
36
|
+
We have large _display_ sizes for headlines (`display-1` and `display-2`), and four standard heading levels (`h1` to `h4`).
|
|
37
|
+
|
|
38
|
+
<Typeset
|
|
39
|
+
fontSizes={[
|
|
40
|
+
Number(typography.size["display-1"]),
|
|
41
|
+
Number(typography.size["display-2"]),
|
|
42
|
+
Number(typography.size.h1),
|
|
43
|
+
Number(typography.size.h2),
|
|
44
|
+
Number(typography.size.h3),
|
|
45
|
+
Number(typography.size.h4),
|
|
46
|
+
]}
|
|
47
|
+
fontWeight={typography.weight.bold}
|
|
48
|
+
sampleText={SampleText}
|
|
49
|
+
fontFamily={typography.type.serif}
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
## Body text
|
|
53
|
+
|
|
54
|
+
Body text is set in **{typography.type["sans-serif"]}**. We have a size variations for variation in emphasis: `extra-large`, `large`, and `small`.
|
|
55
|
+
|
|
56
|
+
<Typeset
|
|
57
|
+
fontSizes={[
|
|
58
|
+
Number(typography.size.h2),
|
|
59
|
+
Number(typography.size.h3),
|
|
60
|
+
Number(typography.size.base),
|
|
61
|
+
Number(typography.size.small),
|
|
62
|
+
]}
|
|
63
|
+
fontWeight={typography.weight.regular}
|
|
64
|
+
sampleText={SampleText}
|
|
65
|
+
fontFamily={typography.type["sans-serif"]}
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
## Highlight text
|
|
69
|
+
|
|
70
|
+
We use a yellow highlight color to draw attention to important information. This is used sparingly, and only for key words or phrases.
|
|
71
|
+
|
|
72
|
+
<Unstyled>
|
|
73
|
+
<p>
|
|
74
|
+
We’ve been working for <span class="highlight">more than a decade</span> with governments and communities across the country to <span class="highlight">break down barriers and find real solutions</span>.
|
|
75
|
+
</p>
|
|
76
|
+
<p class="extra-large">
|
|
77
|
+
We’ve been working for <span class="highlight">more than a decade</span> with governments and communities across the country to <span class="highlight">break down barriers and find real solutions</span>.
|
|
78
|
+
</p>
|
|
79
|
+
</Unstyled>
|