-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path_typography.scss
255 lines (217 loc) · 3.65 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
/**
* Typography
* =================================
* - Base
* - Paragraphs
* - Headings
* - Type sizes
* - Misc
* - Utilities
*
* Body font size, leadings etc have been set in _variables.scss
*
* See http://modularscale.com for
*
*/
html {
font-size: $font-size-base-narrow-px;
-webkit-text-size-adjust: 100%;
@include media('>mid') {
font-size: $font-size-base-px;
}
}
body {
font-family: $font-family-base;
@include ko-font-size(base);
line-height: $leading-base;
color: $color-text;
// Add ligatures
font-feature-settings: "liga", "dlig", "hist";
font-variant-ligatures: common-ligatures discretionary-ligatures historical-ligatures;
// Two ways to smoothen type, they are disabled by default
// Enable only one of them if you need them
// 1.
// -webkit-font-smoothing: antialiased;
// -moz-font-smoothing: antialiased;
// font-smooth:always;
// 2.
// opacity: 0.99;
}
/**
* Paragraphs
*/
p {
font-family: $font-family-base;
@include ko-font-size(base);
margin-top: 0;
margin-bottom: $baseline;
// Measure - ideally about 65 chars per line
// max-width: #{type(base) * 30}px;
}
/**
* Headings
*/
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
font-family: $font-family-headings;
font-weight: $font-weight-headings;
line-height: $line-height-headings;
text-rendering: optimizelegibility; // Fix the character spacing for headings
margin-top: 0;
margin-bottom: $baseline;
small {
font-weight: normal;
}
}
// Use the helper classes to emulate styles for another element
// For example: h3.h1 or h3.alpha
h1,
.h1,
.alpha {
@include ko-font-size(jumbo);
margin-bottom: $baseline * 2;
}
h2,
.h2,
.beta {
@include ko-font-size(large);
}
h3,
.h3,
.gamma {
@include ko-font-size(mid);
}
h4,
.h4,
.delta {
@include ko-font-size(base);
}
h5,
.h5,
.epsilon,
h6,
.h6,
.zeta {
@include ko-font-size(base);
margin-bottom: 0;
}
// Only give these headings a margin-top if they are after other elements
* + h1,
* + .h1,
* + .alpha,
* + h2,
* + .h2,
* + .beta,
* + h3,
* + .h3,
* + .gamma,
* + h4,
* + .h4,
* + .delta {
margin-top: $baseline;
}
small {
font-size: 80%;
}
/**
* Miscellaneous
*/
// Emphasis
strong,
b {
font-weight: $font-weight-bold;
}
em,
i {
font-style: italic;
}
// Abbreviations and acronyms
abbr[title] {
border-bottom: 1px dotted #ddd;
cursor: help;
}
/**
* Blockquotes
*/
blockquote {
padding-left: 10px;
margin: $baseline;
border-left: 4px solid lighten(#000, 80%);
p {
margin-bottom: 0;
@include ko-font-size(base);
font-weight: 300;
}
small {
display: block;
color: lighten(#000, 70%);
&::before {
content: '\2014 \00A0';
}
}
}
// Quotes
q,
blockquote {
&::before,
&::after {
content: "";
}
}
cite {
font-style: normal;
}
// Addresses styling not present in S5, Chrome
dfn {
font-style: italic;
}
// Addresses styling not present in IE6/7/8/9
mark {
background: $yellow;
padding: 2px 4px;
border-radius: 3px;
}
// Prevents sub and sup affecting line-height in all browsers
// gist.github.com/413930
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }
samp { font-family: $font-family-mono; }
/**
* Utilities
*/
.text-centre, // British or US English spellings..
.text-center {
text-align: center;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
@include ko-text-selection($color-selection, $color-selection-bg);
// Horizontal rules
hr {
margin: ($baseline) 0;
border: 0;
height: 1px;
background-color: $hr-color;
}
// https://justmarkup.com/log/2015/07/dealing-with-long-words-in-css/
.hyphenate {
overflow-wrap: break-word;
word-wrap: break-word;
hyphens: auto;
}