/
_typography.scss
170 lines (142 loc) · 2.83 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
/**
* Typography
* =================================
* - Base
* - Paragraphs
* - Headings
* - Type sizes
* - Misc
* - Utilities
*
* Body font size, leadings etc have been set in _variables.scss
*/
html {
font-size: $font-size-base - 2;
-webkit-text-size-adjust: 100%;
// font-variant-ligatures: common-ligatures;
-webkit-font-smoothing: antialiased;
// This needs to come after -webkit-font-smoothing
// stylelint-disable-next-line declaration-block-properties-order
-moz-osx-font-smoothing: grayscale;
text-size-adjust: 100%;
text-rendering: optimizeLegibility;
@include media('>m') {
font-size: $font-size-base;
}
}
html, body {
font-family: $font-family-base;
line-height: $leading-base;
color: ko-color(text);
font-weight: $font-weight-normal;
}
/**
* Paragraphs
*/
p {
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 {
font-family: $font-family-headings;
font-weight: $font-weight-headings;
line-height: $line-height-headings;
margin-top: 0;
margin-bottom: $baseline;
}
h1 {
font-size: ko-font-size(xl);
margin-bottom: ko-multiply(2);
@include media('>m') {
font-size: ko-font-size(xxl);
}
}
h2 {
font-size: ko-font-size(l);
@include media('>m') {
font-size: ko-font-size(xl);
}
}
h3 {
font-size: ko-font-size(m);
@include media('>m') {
font-size: ko-font-size(l);
}
}
h4 {
font-size: ko-font-size(s);
@include media('>m') {
font-size: ko-font-size(m);
}
}
h5, h6 {
font-size: ko-font-size(s);
margin-bottom: 0;
@include media('>m') {
font-size: ko-font-size(m);
}
}
// Only give headings a margin-top if they are after other elements
* + h1, * + h2, * + h3, * + h4, * + h5, * + h6 {
margin-top: $baseline;
}
/**
* 🚨 font-size helper classes
* See https://github.com/TryKickoff/kickoff-utils.scss#_type-sizesscss
* for more info
*
* Usage:
* @include ko-type-sizes();
* @include ko-type-sizes($type, (h1: 50px, h2: 35px, h3: l, h4: m));
*
* Uncomment the line below to include
*/
// @include ko-type-sizes();
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;
}
// 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: ko-font(mono);
}
@include ko-text-selection($color-selection, $color-selection-bg);
// Horizontal rules
hr {
margin: $baseline 0;
border: 0;
height: 1px;
background-color: ko-color(dark);
}