@apolitical/component-library 0.0.4-beta.1 → 0.0.4-beta.11
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/fonts/Moderat-Black-Italic.woff2 +0 -0
- package/fonts/Moderat-Black.woff2 +0 -0
- package/fonts/Moderat-Bold-Italic.woff2 +0 -0
- package/fonts/Moderat-Bold.woff2 +0 -0
- package/fonts/Moderat-Medium-Italic.woff2 +0 -0
- package/fonts/Moderat-Medium.woff2 +0 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +33 -5
- package/layout/index.d.ts +1 -0
- package/layout/layout.d.ts +6 -0
- package/package.json +3 -2
- package/style.css +1 -1
- package/styles/README.md +35 -0
- package/styles/base-styles/_accessibility.scss +26 -0
- package/styles/base-styles/_blockquotes.scss +29 -0
- package/styles/base-styles/_fonts.scss +42 -0
- package/styles/base-styles/_hr.scss +15 -0
- package/styles/base-styles/_index.scss +10 -0
- package/styles/base-styles/_links.scss +16 -0
- package/styles/base-styles/_lists.scss +27 -0
- package/styles/base-styles/_text.scss +80 -0
- package/styles/base-styles/_titles.scss +130 -0
- package/styles/base-styles/buttons/_buttons.scss +234 -0
- package/styles/base-styles/buttons/_icons.scss +24 -0
- package/styles/base-styles/buttons/_index.scss +1 -0
- package/styles/base-styles/buttons/_mixins.scss +30 -0
- package/styles/functions/_index.scss +1 -0
- package/styles/functions/_size-conversions.scss +8 -0
- package/styles/index.scss +9 -0
- package/styles/mixins/_animations.scss +7 -0
- package/styles/mixins/_backgrounds.scss +41 -0
- package/styles/mixins/_breakpoints.scss +18 -0
- package/styles/mixins/_index.scss +4 -0
- package/styles/mixins/_transitions.scss +32 -0
- package/styles/reset/_index.scss +1 -0
- package/styles/reset/_reset.scss +62 -0
- package/styles/variables/_index.scss +3 -0
- package/styles/variables/assets/_assets.scss +4 -0
- package/styles/variables/assets/_index.scss +1 -0
- package/styles/variables/colors/_colors.scss +64 -0
- package/styles/variables/colors/_index.scss +1 -0
- package/styles/variables/colors/_theme.scss +62 -0
- package/styles/variables/sizes/_common.scss +3 -0
- package/styles/variables/sizes/_index.scss +1 -0
- package/index.css +0 -1060
- package/index.css.map +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@import './../functions',
|
|
3
|
+
'./../mixins',
|
|
4
|
+
'./../variables';
|
|
5
|
+
|
|
6
|
+
$pre-title: ('font-size': 14, 'font-size_md': 16, 'letter-spacing': 1.28, 'line-height': 16, 'line-height_md': 20, 'margin-bottom': 24);
|
|
7
|
+
$title: ('font-size': 32, 'font-size_md': 52, 'letter-spacing': -0.16, 'line-height': 40, 'line-height_md': 64, 'margin-bottom': 16, 'margin-bottom_md': 32);
|
|
8
|
+
$h1: ('font-size': 28, 'font-size_md': 40, 'line-height': 32, 'line-height_md': 48, 'letter-spacing': -0.16, 'margin-bottom': 16);
|
|
9
|
+
$h2: ('font-size': 24, 'font-size_md': 28, 'line-height': 32, 'line-height_md': 40, 'margin-top': 40, 'margin-bottom': 16);
|
|
10
|
+
$h3: ('font-size': 20, 'font-size_md': 24, 'line-height': 28, 'line-height_md': 32, 'margin-top': 60, 'margin-bottom': 20);
|
|
11
|
+
$h4: ('font-size': 18, 'font-size_md': 20, 'line-height': 24, 'line-height_md': 28, 'margin-top': 40, 'margin-bottom': 20);
|
|
12
|
+
$h5: ('font-size': 12, 'font-size_md': 14, 'line-height': 16, 'margin-top': 16, 'margin-bottom': 16);
|
|
13
|
+
$h6: ('font-size': 12, 'font-size_md': 11, 'line-height': 16);
|
|
14
|
+
$subtitle: ('font-size': 20, 'font-size_md': 24, 'line-height': 28, 'line-height_md': 32, 'margin-bottom': 20);
|
|
15
|
+
|
|
16
|
+
@layer base {
|
|
17
|
+
.pre-title, h5, h6 {
|
|
18
|
+
color: map.get($theme, 'title');
|
|
19
|
+
text-transform: uppercase;
|
|
20
|
+
font-weight: 700;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.title, h1, h2, h3, h4 {
|
|
24
|
+
color: map.get($theme, 'title');
|
|
25
|
+
font-weight: 900;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pre-title {
|
|
29
|
+
margin-bottom: px-to-rem(map.get($pre-title, 'margin-bottom'));
|
|
30
|
+
font-size: px-to-rem(map.get($pre-title, 'font-size'));
|
|
31
|
+
line-height: px-to-rem(map.get($pre-title, 'line-height'));
|
|
32
|
+
letter-spacing: px-to-rem(map.get($pre-title, 'letter-spacing'));
|
|
33
|
+
text-transform: uppercase;
|
|
34
|
+
|
|
35
|
+
@include breakpoint('min-width', 'md') {
|
|
36
|
+
font-size: px-to-rem(map.get($pre-title, 'font-size_md'));
|
|
37
|
+
line-height: px-to-rem(map.get($title, 'line-height_md'));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.title {
|
|
42
|
+
margin-bottom: px-to-rem(map.get($title, 'margin-bottom'));
|
|
43
|
+
font-size: px-to-rem(map.get($title, 'font-size'));
|
|
44
|
+
line-height: px-to-rem(map.get($title, 'line-height'));
|
|
45
|
+
letter-spacing: px-to-rem(map.get($title, 'letter-spacing'));
|
|
46
|
+
|
|
47
|
+
@include breakpoint('min-width', 'md') {
|
|
48
|
+
font-size: px-to-rem(map.get($title, 'font-size_md'));
|
|
49
|
+
line-height: px-to-rem(map.get($title, 'line-height_md'));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
h1 {
|
|
54
|
+
margin-bottom: px-to-rem(map.get($h1, 'margin-bottom'));
|
|
55
|
+
font-size: px-to-rem(map.get($h1, 'font-size'));
|
|
56
|
+
line-height: px-to-rem(map.get($h1, 'line-height'));
|
|
57
|
+
letter-spacing: px-to-rem(map.get($h1, 'letter-spacing'));
|
|
58
|
+
|
|
59
|
+
@include breakpoint('min-width', 'md') {
|
|
60
|
+
font-size: px-to-rem(map.get($h1, 'font-size_md'));
|
|
61
|
+
line-height: px-to-rem(map.get($h1, 'line-height_md'));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
h2 {
|
|
66
|
+
margin: px-to-rem(map.get($h2, 'margin-top')) 0 px-to-rem(map.get($h2, 'margin-bottom')) 0;
|
|
67
|
+
font-size: px-to-rem(map.get($h2, 'font-size'));
|
|
68
|
+
line-height: px-to-rem(map.get($h2, 'line-height'));
|
|
69
|
+
|
|
70
|
+
@include breakpoint('min-width', 'md') {
|
|
71
|
+
font-size: px-to-rem(map.get($h2, 'font-size_md'));
|
|
72
|
+
line-height: px-to-rem(map.get($h2, 'line-height_md'));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
h3 {
|
|
77
|
+
margin: px-to-rem(map.get($h3, 'margin-top')) 0 px-to-rem(map.get($h3, 'margin-bottom')) 0;
|
|
78
|
+
font-size: px-to-rem(map.get($h3, 'font-size'));
|
|
79
|
+
line-height: px-to-rem(map.get($h3, 'line-height'));
|
|
80
|
+
|
|
81
|
+
@include breakpoint('min-width', 'md') {
|
|
82
|
+
font-size: px-to-rem(map.get($h3, 'font-size_md'));
|
|
83
|
+
line-height: px-to-rem(map.get($h3, 'line-height_md'));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
h4 {
|
|
88
|
+
margin: px-to-rem(map.get($h4, 'margin-top')) 0 px-to-rem(map.get($h4, 'margin-bottom')) 0;
|
|
89
|
+
font-size: px-to-rem(map.get($h4, 'font-size'));
|
|
90
|
+
line-height: px-to-rem(map.get($h4, 'line-height'));
|
|
91
|
+
|
|
92
|
+
@include breakpoint('min-width', 'md') {
|
|
93
|
+
font-size: px-to-rem(map.get($h4, 'font-size_md'));
|
|
94
|
+
line-height: px-to-rem(map.get($h4, 'line-height_md'));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
h5 {
|
|
100
|
+
margin: px-to-rem(map.get($h5, 'margin-top')) 0 px-to-rem(map.get($h5, 'margin-bottom')) 0;
|
|
101
|
+
font-size: px-to-rem(map.get($h5, 'font-size'));
|
|
102
|
+
line-height: px-to-rem(map.get($h5, 'line-height'));
|
|
103
|
+
|
|
104
|
+
@include breakpoint('min-width', 'md') {
|
|
105
|
+
font-size: px-to-rem(map.get($h5, 'font-size_md'));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
h6 {
|
|
110
|
+
font-size: px-to-rem(map.get($h6, 'font-size'));
|
|
111
|
+
line-height: px-to-rem(map.get($h6, 'line-height'));
|
|
112
|
+
|
|
113
|
+
@include breakpoint('min-width', 'md') {
|
|
114
|
+
font-size: px-to-rem(map.get($h6, 'font-size_md'));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.subtitle {
|
|
119
|
+
margin-bottom: px-to-rem(map.get($subtitle, 'margin-bottom'));
|
|
120
|
+
font-size: px-to-rem(map.get($subtitle, 'font-size'));
|
|
121
|
+
color: map.get($theme, 'subtitle');
|
|
122
|
+
font-weight: 400;
|
|
123
|
+
line-height: px-to-rem(map.get($subtitle, 'line-height'));
|
|
124
|
+
|
|
125
|
+
@include breakpoint('min-width', 'md') {
|
|
126
|
+
font-size: px-to-rem(map.get($subtitle, 'font-size_md'));
|
|
127
|
+
line-height: px-to-rem(map.get($subtitle, 'line-height_md'));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@import './../../functions',
|
|
4
|
+
'./../../mixins',
|
|
5
|
+
'./../../variables';
|
|
6
|
+
@import './icons', './mixins';
|
|
7
|
+
|
|
8
|
+
// The button defaults to the primary variant and medium styling so are not added as classes - they live on the default `button` styling
|
|
9
|
+
$large: ('font-size': 18, 'padding-top': 14, 'padding-horizontal': 24, 'padding-bottom': 16, 'icon-width': 18, 'icon-offset': 2, 'icon-gutter': 12);
|
|
10
|
+
$medium: ('font-size': 16, 'padding-top': 10, 'padding-horizontal': 24, 'padding-bottom': 12, 'icon-width': 16, 'icon-offset': 2, 'icon-gutter': 10);
|
|
11
|
+
$small: ('font-size': 14, 'padding-top': 8, 'padding-horizontal': 16, 'padding-bottom': 10, 'icon-width': 12, 'icon-offset': 2, 'icon-gutter': 8);
|
|
12
|
+
$sizes: ('large', $large), ('small', $small);
|
|
13
|
+
$secondary: ('border': 1);
|
|
14
|
+
|
|
15
|
+
// The tertiary styling has its own padding; regardless of size, we add a tiny amount of padding to accommodate
|
|
16
|
+
// the focus outline and to ensure any icons are centered
|
|
17
|
+
$tertiary: ('padding-top': 1.6, 'padding-horizontal': 8,'padding-bottom': 3.2);
|
|
18
|
+
$animation: ('scale': 1.1, 'duration': 0.5, 'iteration': 1);
|
|
19
|
+
|
|
20
|
+
@layer base {
|
|
21
|
+
button, .button {
|
|
22
|
+
background: map.get($theme, 'button_primary_bg');
|
|
23
|
+
padding: px-to-rem(map.get($medium, 'padding-top')) px-to-rem(map.get($medium, 'padding-horizontal'))
|
|
24
|
+
px-to-rem(map.get($medium, 'padding-bottom')) px-to-rem(map.get($medium, 'padding-horizontal'));
|
|
25
|
+
position: relative;
|
|
26
|
+
text-align: center;
|
|
27
|
+
font-size: px-to-rem(map.get($medium, 'font-size'));
|
|
28
|
+
color: map.get($theme, 'button_primary');
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
border-radius: 360rem; // Completely round corners. This could be any large number but 360 evokes a circle well!
|
|
32
|
+
border: none;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
display: inline-block;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background: map.get($theme, 'button_primary_bg_hover');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:active {
|
|
42
|
+
background: map.get($theme, 'button_primary_bg_active');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus, &:focus-visible {
|
|
46
|
+
background: map.get($theme, 'button_primary_bg_focus');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@each $size, $styles in $sizes {
|
|
50
|
+
&.#{$size} {
|
|
51
|
+
padding: px-to-rem(map.get($styles, 'padding-top')) px-to-rem(map.get($styles, 'padding-horizontal'))
|
|
52
|
+
px-to-rem(map.get($styles, 'padding-bottom')) px-to-rem(map.get($styles, 'padding-horizontal'));
|
|
53
|
+
font-size: px-to-rem(map.get($styles, 'font-size'));
|
|
54
|
+
|
|
55
|
+
&.icon {
|
|
56
|
+
margin-top: px-to-rem(map.get($styles, 'icon-offset'));
|
|
57
|
+
|
|
58
|
+
&.left::before { margin-right: px-to-rem(map.get($styles, 'icon-gutter')); }
|
|
59
|
+
&.right::before { margin-left: px-to-rem(map.get($styles, 'icon-gutter')); }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.full-width {
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.destructive {
|
|
69
|
+
&, &:hover, &:active, &:focus, &:focus-visible {
|
|
70
|
+
background: map.get($theme, 'button_primary_destructive_bg');
|
|
71
|
+
color: map.get($theme, 'button_primary_destructive');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:hover, &:active {
|
|
75
|
+
background: map.get($theme, 'button_primary_destructive_bg_hover');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:focus, &:focus-visible {
|
|
79
|
+
box-shadow: $outline map.get($theme, 'button_primary_destructive_box-shadow');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.secondary {
|
|
85
|
+
background: map.get($theme, 'button_secondary_bg');
|
|
86
|
+
color: map.get($theme, 'button_secondary');
|
|
87
|
+
border: px-to-rem(map.get($secondary, 'border')) solid map.get($theme, 'button_secondary_border');
|
|
88
|
+
|
|
89
|
+
&:hover {
|
|
90
|
+
background: map.get($theme, 'button_secondary_bg_hover');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:active, &:focus, &:focus-visible {
|
|
94
|
+
color: map.get($theme, 'button_secondary_focus');
|
|
95
|
+
border-color: map.get($theme, 'button_secondary_border_focus');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:active {
|
|
99
|
+
background: map.get($theme, 'button_secondary_bg_active');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:focus, &:focus-visible {
|
|
103
|
+
background: map.get($theme, 'button_secondary_bg_focus');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.muted {
|
|
107
|
+
border-color: map.get($theme, 'button_secondary_border_muted');
|
|
108
|
+
|
|
109
|
+
&, &:hover, &:active, &:focus, &:focus-visible {
|
|
110
|
+
background: map.get($theme, 'button_secondary_bg_muted');
|
|
111
|
+
color: map.get($theme, 'button_secondary_muted');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:hover, &:focus, &:focus-visible {
|
|
115
|
+
color: map.get($theme, 'button_secondary_muted_hover');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&.disabled {
|
|
120
|
+
&, &:hover, &:active, &:focus, &:focus-visible {
|
|
121
|
+
background: map.get($theme, 'button_secondary_bg_disabled');
|
|
122
|
+
color: map.get($theme, 'button_secondary_disabled');
|
|
123
|
+
border-color: map.get($theme, 'button_secondary_border_disabled');
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&.tertiary {
|
|
129
|
+
@include transition(color text-decoration-color);
|
|
130
|
+
|
|
131
|
+
padding: px-to-rem(map.get($tertiary, 'padding-top')) px-to-rem(map.get($tertiary, 'padding-horizontal'))
|
|
132
|
+
px-to-rem(map.get($tertiary, 'padding-bottom')) px-to-rem(map.get($tertiary, 'padding-horizontal'));
|
|
133
|
+
bottom: px-to-rem(map.get($tertiary, 'padding-top'));
|
|
134
|
+
right: px-to-rem(map.get($tertiary, 'padding-horizontal'));
|
|
135
|
+
text-decoration: underline;
|
|
136
|
+
text-decoration-color: transparent;
|
|
137
|
+
|
|
138
|
+
&, &:focus, &:focus-visible {
|
|
139
|
+
background: map.get($theme, 'button_tertiary_bg');
|
|
140
|
+
color: map.get($theme, 'button_tertiary');
|
|
141
|
+
text-decoration-color: map.get($theme, 'button_tertiary_text-decoration');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&:hover, &:active {
|
|
145
|
+
text-decoration-color: currentcolor;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&:hover {
|
|
149
|
+
color: map.get($theme, 'button_tertiary_hover');
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&:active {
|
|
153
|
+
color: map.get($theme, 'button_tertiary_active');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&.muted {
|
|
157
|
+
color: map.get($theme, 'button_tertiary_muted');
|
|
158
|
+
|
|
159
|
+
&:hover, &:focus, &:focus-visible {
|
|
160
|
+
color: map.get($theme, 'button_tertiary_muted_hover');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&.disabled {
|
|
165
|
+
&, &:hover, &:active, &:focus, &:focus-visible {
|
|
166
|
+
background: map.get($theme, 'button_tertiary_disabled_bg');
|
|
167
|
+
color: map.get($theme, 'button_tertiary_disabled');
|
|
168
|
+
text-decoration-color: map.get($theme, 'button_tertiary_disabled_text-decoration');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&.icon {
|
|
175
|
+
display: inline-flex;
|
|
176
|
+
flex-flow: row;
|
|
177
|
+
align-content: center;
|
|
178
|
+
justify-content: center;
|
|
179
|
+
|
|
180
|
+
&::before {
|
|
181
|
+
content: '';
|
|
182
|
+
background: currentcolor;
|
|
183
|
+
width: px-to-rem(map.get($medium, 'icon-width'));
|
|
184
|
+
height: px-to-rem(map.get($medium, 'icon-width'));
|
|
185
|
+
display: block;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&.right::before { order: 2; }
|
|
189
|
+
|
|
190
|
+
@each $icon, $large-icon, $medium-icon, $small-icon in $icons {
|
|
191
|
+
$icon-sizes: ('large', $large-icon), ('medium', $medium-icon), ('small', $small-icon);
|
|
192
|
+
|
|
193
|
+
@at-root {
|
|
194
|
+
%icon-#{$icon} { @include icon-styling($icon, $icon-sizes); }
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&.#{$icon} {
|
|
198
|
+
@extend %icon-#{$icon};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&.hover_#{$icon} {
|
|
202
|
+
&:hover, &:focus, &:focus-visible {
|
|
203
|
+
@extend %icon-#{$icon};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
&.animate {
|
|
210
|
+
@include animate {
|
|
211
|
+
@keyframes bounce {
|
|
212
|
+
0%, 100% { transform: scale(1); }
|
|
213
|
+
|
|
214
|
+
70% {
|
|
215
|
+
transform: scale(#{map.get($animation, 'scale')});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&:focus, &:active, &.do-animation {
|
|
220
|
+
&::before { animation: bounce #{map.get($animation, 'duration')}s #{map.get($animation, 'iteration')}; }
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&.disabled {
|
|
228
|
+
cursor: not-allowed;
|
|
229
|
+
opacity: 0.3;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Because we can't mix pre-processing and data passed into CSS for file names, like CSS variables or data attributes,
|
|
2
|
+
// icons on buttons need to be set up in advance. To add a new icon, add the name of the file, without the file extension,
|
|
3
|
+
// to the $icons list below.
|
|
4
|
+
// The format is: ('file-name', (small width, small height, small offset, small gutter),
|
|
5
|
+
// (medium width, medium height, medium offset, medium gutter), (large width, large height, large offset, large gutter))
|
|
6
|
+
// By default, icons on buttons use the same width, height, and margin set on the sized lists in `_buttons`, e.g.
|
|
7
|
+
// large buttons default to 18px width, set in $large. If the default values are correct, put `d` as the value.
|
|
8
|
+
// Otherwise, put the value in pixels.
|
|
9
|
+
|
|
10
|
+
$icons: ('arrow_left', (d, d, 3, 8), (d, d, 3, 8), (d, d, 4, 7)),
|
|
11
|
+
('arrow_right', (d, d, 3, 8), (d, d, 3, 8), (d, d, 4, 7)),
|
|
12
|
+
('arrow_corner-down_right', (12, 12, 6, 8), (12, 12, 4, 12), (d, d, d, d)),
|
|
13
|
+
('arrow_corner-down_left', (12, 12, 6, 8), (12, 12, 4, 12), (d, d, d, d)),
|
|
14
|
+
('arrow-down', (d, d, 4, 10), (d, d, 3, 8), (d, d, 4, d)),
|
|
15
|
+
('chevron_left', (16, 16, 4, 8), (14, 14, 3, 8), (14, 14, d, d)),
|
|
16
|
+
('chevron_right', (16, 16, 4, 8), (14, 14, 3, 8), (14, 14, d, d)),
|
|
17
|
+
('heart', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
|
|
18
|
+
('heart_empty', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
|
|
19
|
+
('navigation_arrow', (d, d, 4, 10), (d, d, d, d), (14, 14, d, 10)),
|
|
20
|
+
('pencil', (d, d, d, d), (d, d, d, 11), (d, d, 3, 9)),
|
|
21
|
+
('speech-bubble_square_thick', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
|
|
22
|
+
('star', (16, 16, 0, 0), (d, d, 0, 0), (16, 16, 0, 0)),
|
|
23
|
+
('star_empty', (16, 16, 0, 0), (d, d, 0, 0), (16, 16, 0, 0)),
|
|
24
|
+
('tick', (14, 11, 8, 10), (12, 9, 7, 8), (9, 7, 6, 6));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'buttons';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
@import './../../functions';
|
|
3
|
+
|
|
4
|
+
@mixin icon-styling($icon, $icon-sizes) {
|
|
5
|
+
&::before { @include image('icons/#{$icon}.svg', true); }
|
|
6
|
+
|
|
7
|
+
@each $size, $styles in $icon-sizes {
|
|
8
|
+
@include icon-classes(width, list.nth($styles, 1), $size);
|
|
9
|
+
@include icon-classes(height, list.nth($styles, 2), $size);
|
|
10
|
+
@include icon-classes(margin-top, list.nth($styles, 3), $size);
|
|
11
|
+
@include icon-classes(margin-right, list.nth($styles, 4), $size, 'left');
|
|
12
|
+
@include icon-classes(margin-left, list.nth($styles, 4), $size, 'right');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// If the $value passed in isn't d (for default), render the styling on the passed-in class (if it exists)
|
|
17
|
+
// and the size (if it isn't medium, which is default)
|
|
18
|
+
@mixin icon-classes($property, $value, $size: 'medium', $class: false) {
|
|
19
|
+
@if $value != 'd' {
|
|
20
|
+
$classname: '';
|
|
21
|
+
|
|
22
|
+
@if $class { $classname: '.#{$class}' }
|
|
23
|
+
|
|
24
|
+
@if $size != 'medium' { $classname: $classname + '.#{$size}'; }
|
|
25
|
+
|
|
26
|
+
&#{$classname}:before {
|
|
27
|
+
#{$property}: px-to-rem($value);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'size-conversions';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
// Change px to rem
|
|
4
|
+
// We want to use rem for accessibility, but Figma uses px (which is also a bit easier for us
|
|
5
|
+
// to read and reason about). This mixin does the conversion for us.
|
|
6
|
+
@function px-to-rem($size, $baseTextSize: 16) {
|
|
7
|
+
@return math.div($size, $baseTextSize) + rem;
|
|
8
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@use 'sass:string';
|
|
2
|
+
@import './../variables';
|
|
3
|
+
|
|
4
|
+
// Handle the repeated code for CSS backgrounds. By default, we assume the image is a background image,
|
|
5
|
+
// but if you pass in $is-mask: true, it will be a mask-image instead.
|
|
6
|
+
// If no 'http' is in the image path, we will prepend the image bucket URL, or the asset bucket URL for masks.
|
|
7
|
+
// The asset paths can be passed in directly as part of `$image` to avoid this.
|
|
8
|
+
|
|
9
|
+
@mixin image($image, $is-mask: false, $size: 100% auto, $repeat: no-repeat, $position: 0 0) {
|
|
10
|
+
@if string.index($image, 'http') {
|
|
11
|
+
$image: $image;
|
|
12
|
+
} @else {
|
|
13
|
+
@if $is-mask {
|
|
14
|
+
$image: $assets-bucket + $image;
|
|
15
|
+
} @else {
|
|
16
|
+
$image: $image-bucket + $image;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@if $is-mask {
|
|
21
|
+
@include mask-image($image, $size, $repeat);
|
|
22
|
+
} @else {
|
|
23
|
+
@include background-image($image, $size, $repeat, $position);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@mixin background-image($image, $size: 100% auto, $repeat: no-repeat, $position: 0 0) {
|
|
28
|
+
background-image: url($image);
|
|
29
|
+
background-repeat: $repeat;
|
|
30
|
+
background-position: $position;
|
|
31
|
+
background-size: $size;
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin mask-image($image, $size: 100% auto, $repeat: no-repeat, $position: 0 0) {
|
|
36
|
+
mask-image: url($image);
|
|
37
|
+
mask-repeat: $repeat;
|
|
38
|
+
mask-position: $position;
|
|
39
|
+
mask-size: $size;
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
$breakpoint-sizes: (
|
|
4
|
+
'md': 769
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
// This mixin lets us use fast references for common breakpoints, using the map above,
|
|
8
|
+
// and lets us reference custom breakpoints by passing in a number. It lets us code
|
|
9
|
+
// breakpoints a bit faster by not having to type out the full media query each time.
|
|
10
|
+
@mixin breakpoint($type, $breakpoint) {
|
|
11
|
+
@if map-has-key($breakpoint-sizes, $breakpoint) {
|
|
12
|
+
$breakpoint: map.get($breakpoint-sizes, $breakpoint);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media only screen and (#{$type}: #{$breakpoint}px) {
|
|
16
|
+
@content;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@use 'sass:list';
|
|
2
|
+
|
|
3
|
+
// For accessibility, we need to respect the user's prefers-reduced-motion setting.
|
|
4
|
+
// Find out more: https://css-tricks.com/introduction-reduced-motion-media-query/
|
|
5
|
+
@mixin transition($properties, $duration: 0.2s, $ease: ease-in-out, $delay: 0s) {
|
|
6
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
7
|
+
$transition: ();
|
|
8
|
+
|
|
9
|
+
@for $property from 1 through length($properties) {
|
|
10
|
+
@for $i from 0 to (length($properties)) - (length($duration)) {
|
|
11
|
+
$duration: list.join($duration, list.nth($duration, -1));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@for $i from 0 to (length($properties)) - (length($ease)) {
|
|
15
|
+
$ease: list.join($ease, list.nth($ease, -1));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@for $i from 0 to (length($properties)) - (length($delay)) {
|
|
19
|
+
$delay: list.join($delay, list.nth($delay, -1));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
$transition: list.append(
|
|
23
|
+
$transition,
|
|
24
|
+
(list.nth($properties, $property) list.nth($duration, $property) list.nth($ease, $property) list.nth($delay, $property)),
|
|
25
|
+
$separator: comma
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
transition: $transition;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'reset';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* A reset for all browsers, based on Eric Meyer's CSS reset
|
|
2
|
+
* https://meyerweb.com/eric/tools/css/reset/ */
|
|
3
|
+
|
|
4
|
+
@layer reset {
|
|
5
|
+
html, body, div, span, applet, object, iframe,
|
|
6
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
7
|
+
a, abbr, acronym, address, big, cite, code,
|
|
8
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
9
|
+
small, strike, strong, sub, sup, tt, var,
|
|
10
|
+
b, u, i, center,
|
|
11
|
+
dl, dt, dd, ol, ul, li,
|
|
12
|
+
fieldset, form, label, legend,
|
|
13
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
14
|
+
article, aside, canvas, details, embed,
|
|
15
|
+
figure, figcaption, footer, header, hgroup,
|
|
16
|
+
menu, nav, output, ruby, section, summary,
|
|
17
|
+
time, mark, audio, video {
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
border: 0;
|
|
21
|
+
font: inherit;
|
|
22
|
+
font-size: 100%;
|
|
23
|
+
vertical-align: baseline;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
article, aside, details, figcaption, figure,
|
|
27
|
+
footer, header, hgroup, menu, nav, section {
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
html {
|
|
32
|
+
font-size: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body {
|
|
36
|
+
-moz-osx-font-smoothing: grayscale;
|
|
37
|
+
-webkit-font-smoothing: antialiased;
|
|
38
|
+
|
|
39
|
+
--webkit-text-size-adjust: 100%;
|
|
40
|
+
|
|
41
|
+
text-size-adjust: 100%;
|
|
42
|
+
text-rendering: optimizelegibility;
|
|
43
|
+
line-height: 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ul { list-style: disc; }
|
|
47
|
+
ol { list-style: decimal; }
|
|
48
|
+
|
|
49
|
+
blockquote, q {
|
|
50
|
+
quotes: none;
|
|
51
|
+
|
|
52
|
+
&::before, &::after {
|
|
53
|
+
content: '';
|
|
54
|
+
content: none;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
table {
|
|
59
|
+
border-collapse: collapse;
|
|
60
|
+
border-spacing: 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'assets';
|