-
Notifications
You must be signed in to change notification settings - Fork 33
/
index.html
189 lines (154 loc) · 4.96 KB
/
index.html
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
<!doctype html>
<title>System Font CSS</title>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="system-font.css" rel="stylesheet">
<style>
@font-face {
font-family: monospace;
font-style: normal;
font-weight: 400;
src: local("Menlo-Regular"), local("Monaco"), local("Consolas"), local("DejaVu Sans Mono"), local("DejaVu Sans Mono");
}
@font-face {
font-family: monospace;
font-style: italic;
font-weight: 400;
src: local("Menlo-Regular"), local("Monaco"), local("Consolas-Italic"), local("DejaVu Sans Mono Oblique");
}
@font-face {
font-family: monospace;
font-style: normal;
font-weight: 700;
src: local("Menlo-Regular"), local("Monaco"), local("Consolas-Bold"), local("DejaVu Sans Mono Bold");
}
@font-face {
font-family: monospace;
font-style: italic;
font-weight: 700;
src: local("Menlo-Regular"), local("Monaco"), local("Consolas-BoldItalic"), local("DejaVu Sans Mono Bold Oblique");
}
body {
font: 1em/1.6 system-ui, Tahoma, sans-serif;
margin: 3em auto;
max-width: 40em;
}
@media (max-width: 42em) {
body {
margin: 3em 1em;
}
}
h1,
h2 {
border-bottom: 1px solid #eee;
padding-bottom: .3em;
}
h1 {
margin: 1em 0 1rem;
font-size: 2.25em;
}
h2 {
font-size: 1.75em;
line-height: 1.225;
margin: 1em 0 1rem;
}
code,
pre {
border-radius: 3px;
font-family: "monospace", monospace;
font-size: 85%;
}
p,
pre {
margin: 0 0 1em;
}
code {
background-color: rgba(0,0,0,.04);
padding: .2em;
}
pre {
background-color: #f7f7f7;
line-height: 1.45;
padding: 1em;
-moz-tab-size: 4;
tab-size: 4;
}
a {
color: #4078c0;
text-decoration: none;
}
a:focus,
a:hover {
text-decoration: underline;
}
.token-selector {
color: #0A0;
}
.token-property-name {
color: #44B;
}
.token-property-value {
color: #B50;
}
</style>
<h1>
System Font CSS
</h1>
<p>
System Font CSS is set of <code>@font-face</code> rules that let you use the native system font of the OS running the browser.
</p>
<pre>
<span class="token-selector">body</span> {
<span class="token-property-name">font-family</span>: <span class="token-property-value">system</span>;
}
</pre>
<p>
<a href="https://github.com/jonathantneal/system-font-css">system-font.css</a> offers eight variations of the <code>system</code> font family; <strong>light</strong> (300) <strong>light italic</strong>, <strong>normal</strong> (400), <strong>normal italic</strong>, <strong>medium</strong> (500), <strong>medium italic</strong>, <strong>bold</strong> (700), and <strong>bold italic</strong>.
</p>
<pre>
<span class="token-selector">blockquote</span> {
<span class="token-property-name">font</span>: <span class="token-property-value">italic 300 system</span>;
}
<span class="token-selector">p</span> {
<span class="token-property-name">font</span>: <span class="token-property-value">400 system</span>;
}
</pre>
<h2>
OSX
</h2>
<p>
<strong>OSX</strong> has used three system typefaces. Since <strong>El Capitan</strong> it has used <strong>San Fransisco</strong>. In <strong>Yosemite</strong> it used <strong>Helvetica Neue</strong>. From <strong>Mavericks</strong> back to <strong>Kodiak</strong> it used <strong>Lucida Grande</strong>.
</p>
<h2>
Windows
</h2>
<p>
<strong>Windows</strong> has used four system typefaces. Since <strong>Vista</strong> it has used <strong>Segoe UI</strong>. In XP, it used <strong>Tahoma</strong>, which oddly enough lacks an italic variation. From <strong>Windows ME</strong> back to <strong>Windows 3.1</strong> it used <strong>Microsoft Sans Serif</strong>. Finally, from <strong>Windows 2.0</strong> back to <strong>Windows 1.0</strong> it used <strong>Fixedsys</strong>. Neither <strong>Microsoft Sans Serif</strong> or <strong>Fixedsys</strong> are included in this set, with apologies.
</p>
<p>
Also, for those of opposed to joy, remember that <strong>Internet Explorer 8</strong> does not support local <code>@font-face</code> rules. Therefore, should you need to reference system fonts in that browser then you will need to do so from the <code>font</code> declaration.
</p>
<pre>
<span class="token-selector">body</span> {
<span class="token-property-name">font-family</span>: <span class="token-property-value">system, "Segoe UI", Tahoma</span>;
}
</pre>
<h2>
Android
</h2>
<p>
<strong>Android</strong> has used two system typefaces. Since <strong>Ice Cream Sandwich</strong> it has used <strong>Roboto</strong>. From <strong>Jelly Bean</strong> back to <strong>Cupcake</strong> it used <strong>Droid Sans</strong>, which also lacks an italic variation. Do you suppose OS developers dislike <em>emphasis</em>?
</p>
<h2>
Ubuntu
</h2>
<p>
Ubuntu has always used one system typeface, apty named <strong>Ubuntu</strong>. That part was easy.
</p>
<h2>
Is <code>system</code> going to be a thing?
</h2>
<p>
Maybe. There are <a href="https://lists.w3.org/Archives/Public/www-style/2015Jul/0169.html" target="_blank">discussions in the W3C</a> to standardize a generic <code>system</code> family.
</p>