example.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <!DOCTYPE html>
  2. <html dir="ltr" lang="en">
  3. <head>
  4. <title>Genericons</title>
  5. <link rel="stylesheet" href="genericons.css">
  6. <style type="text/css">
  7. body {
  8. font-family: sans-serif;
  9. line-height: 1.5;
  10. width: 800px;
  11. margin: 50px auto;
  12. color: #777;
  13. background: white;
  14. }
  15. .icons {
  16. overflow: hidden;
  17. padding: 10px 0;
  18. }
  19. .icons div {
  20. cursor: pointer;
  21. float: left;
  22. margin: 0 30px 30px 0;
  23. }
  24. .icons:hover div {
  25. background: #f7f7f7;
  26. }
  27. .code {
  28. display: block;
  29. font: 14px/1.5 monospace;
  30. width: 740px;
  31. white-space: pre;
  32. border: 1px solid #ccc;
  33. padding: 10px;
  34. color: #777;
  35. overflow: auto;
  36. }
  37. .my-icon:before {
  38. content: '\f408';
  39. display: inline-block;
  40. -webkit-font-smoothing: antialiased;
  41. font: normal 32px/1 'Genericons';
  42. vertical-align: middle;
  43. }
  44. /* For the Examples */
  45. .my-checklist {
  46. list-style-type: none;
  47. text-indent: -16px;
  48. }
  49. .my-checklist li:before {
  50. padding-right: 16px;
  51. content: '\f418';
  52. display: inline-block;
  53. -webkit-font-smoothing: antialiased;
  54. font: normal 16px/1 'Genericons';
  55. vertical-align: text-top;
  56. }
  57. .my-blockquote {
  58. background: #eee;
  59. border-left: 32px solid #ddd;
  60. padding: 10px;
  61. }
  62. .my-blockquote:before {
  63. margin-left: -42px;
  64. padding-right: 10px;
  65. content: '\f106';
  66. display: inline-block;
  67. -webkit-font-smoothing: antialiased;
  68. font: normal 32px/20px 'Genericons';
  69. vertical-align: bottom;
  70. }
  71. .my-button {
  72. font-family: Helvetica, sans-serif;
  73. font-size: 14px;
  74. background: #e05d22; /* Old browsers */
  75. background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome10+,Safari5.1+ */
  76. background: -moz-linear-gradient( top, #e05d22 0%, #d94412 100%); /* FF3.6+ */
  77. background: -ms-linear-gradient( top, #e05d22 0%, #d94412 100%); /* IE10+ */
  78. background: -o-linear-gradient( top, #e05d22 0%, #d94412 100%); /* Opera 11.10+ */
  79. background: linear-gradient( to bottom, #e05d22 0%, #d94412 100%); /* W3C */
  80. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e05d22', endColorstr='#d94412', GradientType=0); /* IE6-9 */
  81. display: inline-block;
  82. padding: 10px 16px 4px 16px;
  83. color: #fff;
  84. text-decoration: none;
  85. border: none;
  86. border-bottom: 3px solid #b93207;
  87. border-radius: 2px;
  88. }
  89. .my-button:hover,
  90. .my-button:focus {
  91. background: #ed6a31; /* Old browsers */
  92. background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome10+,Safari5.1+ */
  93. background: -moz-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* FF3.6+ */
  94. background: -ms-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* IE10+ */
  95. background: -o-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* Opera 11.10+ */
  96. background: linear-gradient( to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
  97. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed6a31', endColorstr='#e55627', GradientType=0); /* IE6-9 */
  98. outline: none;
  99. }
  100. .my-button:active {
  101. background: #d94412; /* Old browsers */
  102. background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome10+,Safari5.1+ */
  103. background: -moz-linear-gradient( top, #d94412 0%, #e05d22 100%); /* FF3.6+ */
  104. background: -ms-linear-gradient( top, #d94412 0%, #e05d22 100%); /* IE10+ */
  105. background: -o-linear-gradient( top, #d94412 0%, #e05d22 100%); /* Opera 11.10+ */
  106. background: linear-gradient( to bottom, #d94412 0%, #e05d22 100%); /* W3C */
  107. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d94412', endColorstr='#e05d22', GradientType=0); /* IE6-9 */
  108. border: none;
  109. border-top: 3px solid #b93207;
  110. padding: 6px 16px 7px 16px;
  111. }
  112. </style>
  113. </head>
  114. <body>
  115. <div class="section">
  116. <h1>Genericons Usage</h1>
  117. <p>Copy the <strong>font</strong> folder and the <strong>genericons.css</strong> file together into your project. Link the CSS in your HTML:</p>
  118. <p><code>&lt;link href="path/to/genericons.css" rel="stylesheet"&gt;</code></p>
  119. <p>Drop in the following HTML with the name of the icon you want to display:</p>
  120. <p><code>&lt;div class="genericon genericon-standard"&gt;&lt;/div&gt;</code></p>
  121. <div class="icons">
  122. <!-- post formats -->
  123. <div alt="f100" class="genericon genericon-standard"></div>
  124. <div alt="f101" class="genericon genericon-aside"></div>
  125. <div alt="f102" class="genericon genericon-image"></div>
  126. <div alt="f103" class="genericon genericon-gallery"></div>
  127. <div alt="f104" class="genericon genericon-video"></div>
  128. <div alt="f105" class="genericon genericon-status"></div>
  129. <div alt="f106" class="genericon genericon-quote"></div>
  130. <div alt="f107" class="genericon genericon-link"></div>
  131. <div alt="f108" class="genericon genericon-chat"></div>
  132. <div alt="f109" class="genericon genericon-audio"></div>
  133. <!-- social icons -->
  134. <div alt="f200" class="genericon genericon-github"></div>
  135. <div alt="f201" class="genericon genericon-dribbble"></div>
  136. <div alt="f202" class="genericon genericon-twitter"></div>
  137. <div alt="f203" class="genericon genericon-facebook"></div>
  138. <div alt="f204" class="genericon genericon-facebook-alt"></div>
  139. <div alt="f205" class="genericon genericon-wordpress"></div>
  140. <div alt="f206" class="genericon genericon-googleplus"></div>
  141. <div alt="f207" class="genericon genericon-linkedin"></div>
  142. <div alt="f208" class="genericon genericon-linkedin-alt"></div>
  143. <div alt="f209" class="genericon genericon-pinterest"></div>
  144. <div alt="f210" class="genericon genericon-pinterest-alt"></div>
  145. <div alt="f211" class="genericon genericon-flickr"></div>
  146. <div alt="f212" class="genericon genericon-vimeo"></div>
  147. <div alt="f213" class="genericon genericon-youtube"></div>
  148. <div alt="f214" class="genericon genericon-tumblr"></div>
  149. <div alt="f215" class="genericon genericon-instagram"></div>
  150. <div alt="f216" class="genericon genericon-codepen"></div>
  151. <div alt="f217" class="genericon genericon-polldaddy"></div>
  152. <div alt="f218" class="genericon genericon-googleplus-alt"></div>
  153. <div alt="f219" class="genericon genericon-path"></div>
  154. <div alt="f220" class="genericon genericon-skype"></div>
  155. <div alt="f221" class="genericon genericon-digg"></div>
  156. <div alt="f222" class="genericon genericon-reddit"></div>
  157. <div alt="f223" class="genericon genericon-stumbleupon"></div>
  158. <div alt="f224" class="genericon genericon-pocket"></div>
  159. <div alt="f225" class="genericon genericon-dropbox"></div>
  160. <!-- meta icons -->
  161. <div alt="f300" class="genericon genericon-comment"></div>
  162. <div alt="f301" class="genericon genericon-category"></div>
  163. <div alt="f302" class="genericon genericon-tag"></div>
  164. <div alt="f303" class="genericon genericon-time"></div>
  165. <div alt="f304" class="genericon genericon-user"></div>
  166. <div alt="f305" class="genericon genericon-day"></div>
  167. <div alt="f306" class="genericon genericon-week"></div>
  168. <div alt="f307" class="genericon genericon-month"></div>
  169. <div alt="f308" class="genericon genericon-pinned"></div>
  170. <!-- other icons -->
  171. <div alt="f400" class="genericon genericon-search"></div>
  172. <div alt="f401" class="genericon genericon-unzoom"></div>
  173. <div alt="f402" class="genericon genericon-zoom"></div>
  174. <div alt="f403" class="genericon genericon-show"></div>
  175. <div alt="f404" class="genericon genericon-hide"></div>
  176. <div alt="f405" class="genericon genericon-close"></div>
  177. <div alt="f406" class="genericon genericon-close-alt"></div>
  178. <div alt="f407" class="genericon genericon-trash"></div>
  179. <div alt="f408" class="genericon genericon-star"></div>
  180. <div alt="f409" class="genericon genericon-home"></div>
  181. <div alt="f410" class="genericon genericon-mail"></div>
  182. <div alt="f411" class="genericon genericon-edit"></div>
  183. <div alt="f412" class="genericon genericon-reply"></div>
  184. <div alt="f413" class="genericon genericon-feed"></div>
  185. <div alt="f414" class="genericon genericon-warning"></div>
  186. <div alt="f415" class="genericon genericon-share"></div>
  187. <div alt="f416" class="genericon genericon-attachment"></div>
  188. <div alt="f417" class="genericon genericon-location"></div>
  189. <div alt="f418" class="genericon genericon-checkmark"></div>
  190. <div alt="f419" class="genericon genericon-menu"></div>
  191. <div alt="f420" class="genericon genericon-refresh"></div>
  192. <div alt="f421" class="genericon genericon-minimize"></div>
  193. <div alt="f422" class="genericon genericon-maximize"></div>
  194. <div alt="f423" class="genericon genericon-404"></div>
  195. <div alt="f424" class="genericon genericon-spam"></div>
  196. <div alt="f425" class="genericon genericon-summary"></div>
  197. <div alt="f426" class="genericon genericon-cloud"></div>
  198. <div alt="f427" class="genericon genericon-key"></div>
  199. <div alt="f428" class="genericon genericon-dot"></div>
  200. <div alt="f429" class="genericon genericon-next"></div>
  201. <div alt="f430" class="genericon genericon-previous"></div>
  202. <div alt="f431" class="genericon genericon-expand"></div>
  203. <div alt="f432" class="genericon genericon-collapse"></div>
  204. <div alt="f433" class="genericon genericon-dropdown"></div>
  205. <div alt="f434" class="genericon genericon-dropdown-left"></div>
  206. <div alt="f435" class="genericon genericon-top"></div>
  207. <div alt="f436" class="genericon genericon-draggable"></div>
  208. <div alt="f437" class="genericon genericon-phone"></div>
  209. <div alt="f438" class="genericon genericon-send-to-phone"></div>
  210. <div alt="f439" class="genericon genericon-plugin"></div>
  211. <div alt="f440" class="genericon genericon-cloud-download"></div>
  212. <div alt="f441" class="genericon genericon-cloud-upload"></div>
  213. <div alt="f442" class="genericon genericon-external"></div>
  214. <div alt="f443" class="genericon genericon-document"></div>
  215. <div alt="f444" class="genericon genericon-book"></div>
  216. <div alt="f445" class="genericon genericon-cog"></div>
  217. <div alt="f446" class="genericon genericon-unapprove"></div>
  218. <div alt="f447" class="genericon genericon-cart"></div>
  219. <div alt="f448" class="genericon genericon-pause"></div>
  220. <div alt="f449" class="genericon genericon-stop"></div>
  221. <div alt="f450" class="genericon genericon-skip-back"></div>
  222. <div alt="f451" class="genericon genericon-skip-ahead"></div>
  223. <div alt="f452" class="genericon genericon-play"></div>
  224. <div alt="f453" class="genericon genericon-tablet"></div>
  225. <div alt="f454" class="genericon genericon-send-to-tablet"></div>
  226. <div alt="f455" class="genericon genericon-info"></div>
  227. <div alt="f456" class="genericon genericon-notice"></div>
  228. <div alt="f457" class="genericon genericon-help"></div>
  229. <div alt="f458" class="genericon genericon-fastforward"></div>
  230. <div alt="f459" class="genericon genericon-rewind"></div>
  231. <div alt="f460" class="genericon genericon-portfolio"></div>
  232. <div alt="f461" class="genericon genericon-heart"></div>
  233. <div alt="f462" class="genericon genericon-code"></div>
  234. <div alt="f463" class="genericon genericon-subscribe"></div>
  235. <div alt="f464" class="genericon genericon-unsubscribe"></div>
  236. <div alt="f465" class="genericon genericon-subscribed"></div>
  237. <div alt="f466" class="genericon genericon-reply-alt"></div>
  238. <div alt="f467" class="genericon genericon-reply-single"></div>
  239. <div alt="f468" class="genericon genericon-flag"></div>
  240. <div alt="f469" class="genericon genericon-print"></div>
  241. <div alt="f470" class="genericon genericon-lock"></div>
  242. <div alt="f471" class="genericon genericon-bold"></div>
  243. <div alt="f472" class="genericon genericon-italic"></div>
  244. <div alt="f473" class="genericon genericon-picture"></div>
  245. <div alt="f474" class="genericon genericon-fullscreen"></div>
  246. <!-- generic shapes -->
  247. <div alt="f500" class="genericon genericon-uparrow"></div>
  248. <div alt="f501" class="genericon genericon-rightarrow"></div>
  249. <div alt="f502" class="genericon genericon-downarrow"></div>
  250. <div alt="f503" class="genericon genericon-leftarrow"></div>
  251. </div>
  252. <p>If you want to insert an icon manually using the <code>:before</code> selector, you can setup CSS rules like the following example. <strong>Make sure to set the size to a multiple of 16px</strong> or the icons could end up looking fuzzy:</p>
  253. <p><textarea class="code" style="min-height: 150px;" onclick="select();">.my-icon:before {
  254. content: '\f408';
  255. display: inline-block;
  256. -webkit-font-smoothing: antialiased;
  257. font: normal 32px/1 'Genericons';
  258. vertical-align: middle;
  259. }</textarea></p>
  260. <p>Add a matching class to your HTML:</p>
  261. <p><code>&lt;div class="my-icon"&gt;You're a Star!&lt;/div&gt;</code></p>
  262. <p>Here's the result: <span class="my-icon">You're a Star!</span></p>
  263. <h2>Examples</h2>
  264. <p>Turn every icon a <span style="color: #fa8072;">Salmon</span> color:</p>
  265. <p><textarea class="code" style="min-height: 70px" onclick="select();">
  266. .genericon {
  267. color: #fa8072;
  268. }</textarea></p>
  269. <p>Or turn the stars <span style="color: #ffd700;">Gold</span>:</p>
  270. <p><textarea class="code" style="min-height: 70px" onclick="select();">
  271. .genericon-star {
  272. color: #fa8072;
  273. }</textarea></p>
  274. <p>Use icons for bulleted lists:</p>
  275. <ul class="my-checklist">
  276. <li>One</li>
  277. <li>Two</li>
  278. <li>Three</li>
  279. <li>Four</li>
  280. </ul>
  281. <p><textarea class="code" style="min-height: 130px" onclick="select();">
  282. <ul class="my-checklist">
  283. <li>One</li>
  284. <li>Two</li>
  285. <li>Three</li>
  286. <li>Four</li>
  287. </ul></textarea></p>
  288. <p><textarea class="code" style="min-height: 260px;" onclick="select();">
  289. .my-checklist {
  290. list-style-type: none;
  291. text-indent: -16px;
  292. }
  293. .my-checklist li:before {
  294. padding-right: 16px;
  295. content: '\f418';
  296. display: inline-block;
  297. -webkit-font-smoothing: antialiased;
  298. font: normal 16px/1 'Genericons';
  299. vertical-align: text-top;
  300. }</textarea></p>
  301. <p>Use icons to style blockquotes:</p>
  302. <blockquote class="my-blockquote">Sometimes I've believed as many as six impossible things before breakfast. &mdash;<em>Lewis Carroll</em></blockquote>
  303. <blockquote class="my-blockquote">`Twas brillig, and the slithy toves Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe. "Beware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!"</blockquote>
  304. <p><textarea class="code" style="min-height: 40px;" onclick="select();"><blockquote class="my-blockquote">Sometimes I've believed as many as six impossible things before breakfast. &mdash;<em>Lewis Carroll</em></blockquote></textarea></p>
  305. <p><textarea class="code" style="min-height: 300px;" onclick="select();">
  306. .my-blockquote {
  307. background: #eee;
  308. border-left: 32px solid #ddd;
  309. padding: 10px;
  310. }
  311. .my-blockquote:before {
  312. margin-left: -42px;
  313. padding-right: 10px;
  314. content: '\f106';
  315. display: inline-block;
  316. -webkit-font-smoothing: antialiased;
  317. font: normal 32px/20px 'Genericons';
  318. vertical-align: bottom;
  319. } </textarea></p>
  320. <p>Use icons to style buttons:</p>
  321. <a class="my-button" href="javascript:void()"><i class="genericon genericon-show"></i> View</a>
  322. <a class="my-button" href="javascript:void()"><i class="genericon genericon-audio"></i> Listen</a>
  323. <p><textarea class="code" style="min-height: 40px;" onclick="select();"><a class="my-button" href="#"><i class="genericon genericon-show"></i> View</a>
  324. <a class="my-button" href="#"><i class="genericon genericon-audio"></i> Listen</a></textarea></p>
  325. <p><textarea class="code" style="min-height: 300px;" onclick="select();">
  326. .my-button {
  327. font-family: Helvetica, sans-serif;
  328. background: #e05d22; /* Old browsers */
  329. background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome10+,Safari5.1+ */
  330. background: -moz-linear-gradient( top, #e05d22 0%, #d94412 100%); /* FF3.6+ */
  331. background: -ms-linear-gradient( top, #e05d22 0%, #d94412 100%); /* IE10+ */
  332. background: -o-linear-gradient( top, #e05d22 0%, #d94412 100%); /* Opera 11.10+ */
  333. background: linear-gradient( to bottom, #e05d22 0%, #d94412 100%); /* W3C */
  334. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e05d22', endColorstr='#d94412', GradientType=0); /* IE6-9 */
  335. display: inline-block;
  336. padding: 10px 16px 6px 16px;
  337. color: #fff;
  338. text-decoration: none;
  339. border: none;
  340. border-bottom: 3px solid #b93207;
  341. border-radius: 2px;
  342. }
  343. .my-button:hover,
  344. .my-button:focus {
  345. background: #ed6a31; /* Old browsers */
  346. background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome10+,Safari5.1+ */
  347. background: -moz-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* FF3.6+ */
  348. background: -ms-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* IE10+ */
  349. background: -o-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* Opera 11.10+ */
  350. background: linear-gradient( to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
  351. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed6a31', endColorstr='#e55627', GradientType=0); /* IE6-9 */
  352. outline: none;
  353. }
  354. .my-button:active {
  355. background: #d94412; /* Old browsers */
  356. background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome10+,Safari5.1+ */
  357. background: -moz-linear-gradient( top, #d94412 0%, #e05d22 100%); /* FF3.6+ */
  358. background: -ms-linear-gradient( top, #d94412 0%, #e05d22 100%); /* IE10+ */
  359. background: -o-linear-gradient( top, #d94412 0%, #e05d22 100%); /* Opera 11.10+ */
  360. background: linear-gradient( to bottom, #d94412 0%, #e05d22 100%); /* W3C */
  361. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d94412', endColorstr='#e05d22', GradientType=0); /* IE6-9 */
  362. border: none;
  363. border-top: 3px solid #b93207;
  364. padding: 6px 16px 10px 16px;
  365. }</textarea>/</p>
  366. <h2>CSS Preprocessors</h2>
  367. <p>Preprocessing extensions such as Sass (SCSS Syntax) or LESS</a> can make it easier to manage CSS for a lot of things at once using things like variables and mixins.</p>
  368. <p>This example will seup the basic genericon rules and sets a color you can use for all icons using Sass:</p>
  369. <p><textarea class="code" style="min-height: 360px;" onclick="select();">$icon-color: "#fa8072";
  370. .genericon {
  371. color: $icon-color;
  372. }
  373. @mixin genericon-rules {
  374. display: inline-block;
  375. -webkit-font-smoothing: antialiased;
  376. font: normal 16px/1 'Genericons';
  377. vertical-align: middle;
  378. }
  379. .my-icon:before {
  380. content: '\f408';
  381. @include genericon-rules;
  382. }</textarea></p>
  383. <p>Here is a similar example for LESS:</p>
  384. <p><textarea class="code" style="min-height: 360px;" onclick="select();">@icon-color: "#fa8072";
  385. .genericon {
  386. color: @icon-color;
  387. }
  388. .genericon-rules {
  389. display: inline-block;
  390. -webkit-font-smoothing: antialiased;
  391. font: normal 16px/1 'Genericons';
  392. vertical-align: middle;
  393. }
  394. .my-icon:before {
  395. content: '\f408';
  396. .genericon-rules;
  397. }</textarea></p>
  398. <h2>Fallback images for IE7 and below</h2>
  399. <p>Genericons <strong>does not come with fallback icons by default</strong> -- therefore you have to create them yourself. If you are using HTML similar to this example:
  400. <p><code>&lt;span class="genericon genericon-warning"&gt;&lt;/span&gt;</code></p>
  401. <p>You can use the asterisk hack to serve a different icon to IE7 once you have saved the fallback icons to your project:</p>
  402. <textarea class="code" style="min-height: 85px;" onclick="select();">.genericon-warning {
  403. *background: url(fallback-icon.png) no-repeat center center;
  404. *text-indent: 100%;
  405. }</textarea>
  406. </div>
  407. </body>
  408. </html>