This repository was archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathmarkup.html
172 lines (156 loc) · 5.15 KB
/
markup.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Icon Fonts</title>
<link rel="stylesheet" href="docs.css">
<link rel="stylesheet" href="afontgarde.css">
<link rel="stylesheet" href="/demo-head/demohead.css">
<style>
body {
font-family: sans-serif;
}
.docs-main {
max-width: 37.5em;
margin: 0 1em;
}
@media (min-width: 39.5em){
.docs-main {
margin: 0 auto;
}
}
pre {
white-space: pre-line;
}
@font-face {
font-family: icomoon;
src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
url('fonts/icomoon.woff') format('woff'),
url('fonts/icomoon.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
/***************************
* A-Grade Icons
***************************/
.icomoon .icon:before {
font-family: icomoon;
}
/* Icons */
.icomoon .icon-twitter:before {
content: "\e604";
}
.icomoon .icon-google-plus:before {
content: "\e600";
}
.icomoon .icon-facebook:before {
content: "\e602";
}
.icomoon .icon-feed:before {
content: "\e605";
}
/***************************
* Fallback Glyph
***************************/
.icon-fallback-glyph .icon-hamburger:before {
content: "\2261"; /* Hamburger */
font-size: 2em;
line-height: .5;
}
/* A-Grade */
.icomoon .icon-fallback-glyph .icon-hamburger:before {
content: "\e601";
}
</style>
</head>
<body>
<div class="demo-header">
<div class="company">
<img src="http://filamentgroup.com/images/fg-logo-positive-sm-crop.png">
</div>
<div class="details">
<p class="description-container">Demo of <span class="repo-name">A Font Garde</span>
<span class="description">A variety of test cases and tools for safe font-icon usage.</span>
</p>
<ul class="outbound-links">
<li><a href="https://github.com/filamentgroup/a-font-garde">Code</a></li>
<li><a href="http://filamentgroup.com/lab/bulletproof_icon_fonts.html">Article</a></li>
<li><a href="https://github.com/filamentgroup/a-font-garde/issues">Issues</a></li>
</ul>
</div>
</div>
<div class="docs-main">
<h2>Use Case #1: Critical Icons with Fallback Text</h2>
<p>Doesn’t show supplementary text, but must show fallback text without the icon. Supplementary text is still available to screen readers.<p>
<span class="icon-fallback-text">
<!-- requires an element for aria-hidden -->
<span class="icon icon-twitter" aria-hidden="true"></span>
<span class="text">Twitter</span>
</span>
<span class="icon-fallback-text">
<!-- requires an element for aria-hidden -->
<span class="icon icon-facebook" aria-hidden="true"></span>
<span class="text">Facebook</span>
</span>
<span class="icon-fallback-text">
<!-- requires an element for aria-hidden -->
<span class="icon icon-google-plus" aria-hidden="true"></span>
<span class="text">Google Plus</span>
</span>
<span class="icon-fallback-text">
<!-- requires an element for aria-hidden -->
<span class="icon icon-feed" aria-hidden="true"></span>
<span class="text">RSS Feed</span>
</span>
<h3>HTML</h3>
<pre><code>
<span class="icon-fallback-text">
<!-- requires an element for aria-hidden -->
<span class="icon icon-twitter" aria-hidden="true"></span>
<span class="text">Twitter</span>
</span>
</code></pre>
<h3>Failed experiments:</h3>
<ul>
<li>Eliminate the span element and clip to just show the icon. Requires us to know the width of each glyph. It’s better to just keep the span.</li>
</ul>
<h2>Use Case #2: Critical Icons with Fallback Icon</h2>
<p>Doesn’t show supplementary text, must show fallback icon without the primary icon. This can be a background image or a Unicode glyph. Supplementary text is still available to screen readers.<p>
<h3>Fallback to Glyph</h3>
<span class="icon-fallback-glyph">
<span class="icon icon-hamburger" aria-hidden="true"></span>
<span class="text">Menu</span>
</span>
<p>Warning: In browsers that don’t support :before/:after (IE6-7), fallback is text.</p>
<h4>HTML</h4>
<pre><code>
<span class="icon-fallback-glyph">
<span class="icon icon-hamburger" aria-hidden="true"></span>
<span class="text">Menu</span>
</span>
</code></pre>
<h2>Use Case #3: Decorative Icon without Fallback</h2>
<p>Shows supplementary text, does not need fallback experience without the icon.</p>
<span class="icon icon-twitter" aria-hidden="true"></span>
Share on Twitter (Sibling Text)
<h3>HTML</h4>
<pre><code>
<span class="icon icon-twitter" aria-hidden="true"></span>
Share on Twitter (Sibling Text)
</code></pre>
</div>
<script src="lib/modernizr.fontface-generatedcontent.js"></script>
<script src="afontgarde.js"></script>
<script>
// AFontGarde( 'icomoon', '\uE600\uE601\uE602\uE605' );
AFontGarde( 'icomoon', {
glyphs: '\uE600\uE601\uE602\uE605',
success: function() { console.log( 'success' ); },
error: function() { console.log( 'timeout error' ); },
timeout: 10000
});
</script>
<script src="/demo-head/loadfont.js"></script>
</body>
</html>