-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathtypography.scss
333 lines (273 loc) · 7.43 KB
/
typography.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
// stylelint-disable primer/typography
// Type scale variables found in ../support/lib/variables.scss
// $h00-size-mobile: 40px;
// $h0-size-mobile: 32px;
// $h1-size-mobile: 26px;
// $h2-size-mobile: 22px;
// $h3-size-mobile: 18px;
// $h00-size: 48px;
// $h0-size: 40px;
// $h1-size: 32px;
// $h2-size: 24px;
// $h3-size: 20px;
// $h4-size: 16px;
// $h5-size: 14px;
// $h6-size: 12px;
/* Set the font size to 26px */
.h1 {
font-size: var(--h1-size-mobile, $h1-size-mobile) !important;
@include breakpoint(md) {
font-size: var(--h1-size, $h1-size) !important;
}
}
/* Set the font size to 22px */
.h2 {
font-size: var(--h2-size-mobile, $h2-size-mobile) !important;
@include breakpoint(md) {
font-size: var(--h2-size, $h2-size) !important;
}
}
/* Set the font size to 18px */
.h3 {
font-size: var(--h3-size-mobile, $h3-size-mobile) !important;
@include breakpoint(md) {
font-size: var(--h3-size, $h3-size) !important;
}
}
/* Set the font size to #{$h4-size} */
.h4 {
font-size: var(--h4-size, $h4-size) !important;
}
/* Set the font size to #{$h5-size} */
.h5 {
font-size: var(--h5-size, $h5-size) !important;
}
// Does not include color property like typography base
// styles, color should be applied with color utilities.
/* Set the font size to #{$h6-size} */
.h6 {
font-size: var(--h6-size, $h6-size) !important;
}
// Heading utilities
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-weight: $font-weight-bold !important;
}
// Type utilities that match type sale
/* Set the font size to 26px */
.f1 {
font-size: var(--h1-size-mobile, $h1-size-mobile) !important;
@include breakpoint(md) {
font-size: var(--h1-size, $h1-size) !important;
}
}
/* Set the font size to 22px */
.f2 {
font-size: var(--h2-size-mobile, $h2-size-mobile) !important;
@include breakpoint(md) {
font-size: var(--h2-size, $h2-size) !important;
}
}
/* Set the font size to 18px */
.f3 {
font-size: var(--h3-size-mobile, $h3-size-mobile) !important;
@include breakpoint(md) {
font-size: var(--h3-size, $h3-size) !important;
}
}
/* Set the font size to #{$h4-size} */
.f4 {
font-size: var(--h4-size, $h4-size) !important;
@include breakpoint(md) {
font-size: var(--h4-size, $h4-size) !important;
}
}
/* Set the font size to #{$h5-size} */
.f5 {
font-size: var(--h5-size, $h5-size) !important;
}
/* Set the font size to #{$h6-size} */
.f6 {
font-size: var(--h6-size, $h6-size) !important;
}
// Type utils with light weight that match type scale
/* Set the font size to 40px and weight to light */
.f00-light {
font-size: var(--h00-size-mobile, $h00-size-mobile) !important;
font-weight: $font-weight-light !important;
@include breakpoint(md) {
font-size: var(--h00-size, $h00-size) !important;
}
}
/* Set the font size to 32px and weight to light */
.f0-light {
font-size: var(--h0-size-mobile, $h0-size-mobile) !important;
font-weight: $font-weight-light !important;
@include breakpoint(md) {
font-size: var(--h0-size, $h0-size) !important;
}
}
/* Set the font size to 26px and weight to light */
.f1-light {
font-size: var(--h1-size-mobile, $h1-size-mobile) !important;
font-weight: $font-weight-light !important;
@include breakpoint(md) {
font-size: var(--h1-size, $h1-size) !important;
}
}
/* Set the font size to 22px and weight to light */
.f2-light {
font-size: var(--h2-size-mobile, $h2-size-mobile) !important;
font-weight: $font-weight-light !important;
@include breakpoint(md) {
font-size: var(--h2-size, $h2-size) !important;
}
}
// Same size and weight as .lead but without color property
/* Set the font size to 18px and weight to light */
.f3-light {
font-size: var(--h3-size-mobile, $h3-size-mobile) !important;
font-weight: $font-weight-light !important;
@include breakpoint(md) {
font-size: var(--h3-size, $h3-size) !important;
}
}
// Smallest text size
/* Set the font size to ${#h6-size} */
.text-small {
font-size: var(--h6-size, $h6-size) !important;
}
// 12px
/* Large leading paragraphs */
.lead {
// stylelint-disable-next-line primer/spacing
margin-bottom: 30px;
font-size: var(--h3-size, $h3-size);
font-weight: $font-weight-light;
}
// Line-height variations
// Close to commonly used line-heights. Most line-heights
// combined with type size equate to whole pixels.
// Will be improved with future typography scale updates.
// Responsive line-height
@each $breakpoint, $variant in $responsive-variants {
@include breakpoint($breakpoint) {
/* Set the line height to ultra condensed */
.lh#{$variant}-condensed-ultra {
line-height: $lh-condensed-ultra !important;
}
/* Set the line height to condensed */
.lh#{$variant}-condensed {
line-height: $lh-condensed !important;
}
/* Set the line height to default */
.lh#{$variant}-default {
line-height: $lh-default !important;
}
/* Set the line height to zero */
.lh#{$variant}-0 {
line-height: 0 !important;
}
}
}
// Text alignments
// Responsive text alignment
@each $breakpoint, $variant in $responsive-variants {
@include breakpoint($breakpoint) {
/* Text align to the right */
.text#{$variant}-right {
text-align: right !important;
}
/* Text align to the left */
.text#{$variant}-left {
text-align: left !important;
}
/* Text align to the center */
.text#{$variant}-center {
text-align: center !important;
}
}
}
// Text styles
/* Set the font weight to normal */
.text-normal {
font-weight: $font-weight-normal !important;
}
/* Set the font weight to bold */
.text-bold {
font-weight: $font-weight-bold !important;
}
.text-semibold {
font-weight: $font-weight-semibold !important;
}
.text-light {
font-weight: $font-weight-light !important;
}
/* Set the font to italic */
.text-italic {
font-style: italic !important;
}
/* Make text uppercase */
.text-uppercase {
text-transform: uppercase !important;
}
/* Underline text */
.text-underline {
text-decoration: underline !important;
}
/* Don't underline text */
.no-underline {
text-decoration: none !important;
}
/* Don't wrap white space */
.no-wrap {
white-space: nowrap !important;
}
/* Normal white space */
.ws-normal {
white-space: normal !important;
}
/* Force long "words" to wrap if they exceed the width of the container */
.wb-break-word {
// stylelint-disable-next-line declaration-property-value-keyword-no-deprecated
word-break: break-word !important;
// this is for backwards compatibility with browsers that don't respect overflow-wrap
word-wrap: break-word !important;
overflow-wrap: break-word !important;
}
/*
* Specifically apply word-break: break-all; per MDN:
*
* > Note: In contrast to `word-break: break-word` and `overflow-wrap: break-word`,
* > `word-break: break-all` will create a break at the exact place where text would
* > otherwise overflow its container (even if putting an entire word on its own line
* > would negate the need for a break).
*
* see: https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#Values
*/
.wb-break-all {
word-break: break-all !important;
}
.text-emphasized {
font-weight: $font-weight-bold;
}
// List styles
.list-style-none {
list-style: none !important;
}
/* Set to monospace font */
.text-mono {
font-family: $mono-font !important;
}
/* Disallow user from selecting text */
.user-select-none {
user-select: none !important;
}
/* Make text capitalized (transforms first character to uppercase) */
.text-capitalize {
text-transform: capitalize !important;
}