example.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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. <!-- meta icons -->
  160. <div alt="f300" class="genericon genericon-comment"></div>
  161. <div alt="f301" class="genericon genericon-category"></div>
  162. <div alt="f302" class="genericon genericon-tag"></div>
  163. <div alt="f303" class="genericon genericon-time"></div>
  164. <div alt="f304" class="genericon genericon-user"></div>
  165. <div alt="f305" class="genericon genericon-day"></div>
  166. <div alt="f306" class="genericon genericon-week"></div>
  167. <div alt="f307" class="genericon genericon-month"></div>
  168. <div alt="f308" class="genericon genericon-pinned"></div>
  169. <!-- other icons -->
  170. <div alt="f400" class="genericon genericon-search"></div>
  171. <div alt="f401" class="genericon genericon-unzoom"></div>
  172. <div alt="f402" class="genericon genericon-zoom"></div>
  173. <div alt="f403" class="genericon genericon-show"></div>
  174. <div alt="f404" class="genericon genericon-hide"></div>
  175. <div alt="f405" class="genericon genericon-close"></div>
  176. <div alt="f406" class="genericon genericon-close-alt"></div>
  177. <div alt="f407" class="genericon genericon-trash"></div>
  178. <div alt="f408" class="genericon genericon-star"></div>
  179. <div alt="f409" class="genericon genericon-home"></div>
  180. <div alt="f410" class="genericon genericon-mail"></div>
  181. <div alt="f411" class="genericon genericon-edit"></div>
  182. <div alt="f412" class="genericon genericon-reply"></div>
  183. <div alt="f413" class="genericon genericon-feed"></div>
  184. <div alt="f414" class="genericon genericon-warning"></div>
  185. <div alt="f415" class="genericon genericon-share"></div>
  186. <div alt="f416" class="genericon genericon-attachment"></div>
  187. <div alt="f417" class="genericon genericon-location"></div>
  188. <div alt="f418" class="genericon genericon-checkmark"></div>
  189. <div alt="f419" class="genericon genericon-menu"></div>
  190. <div alt="f420" class="genericon genericon-refresh"></div>
  191. <div alt="f421" class="genericon genericon-minimize"></div>
  192. <div alt="f422" class="genericon genericon-maximize"></div>
  193. <div alt="f423" class="genericon genericon-404"></div>
  194. <div alt="f424" class="genericon genericon-spam"></div>
  195. <div alt="f425" class="genericon genericon-summary"></div>
  196. <div alt="f426" class="genericon genericon-cloud"></div>
  197. <div alt="f427" class="genericon genericon-key"></div>
  198. <div alt="f428" class="genericon genericon-dot"></div>
  199. <div alt="f429" class="genericon genericon-next"></div>
  200. <div alt="f430" class="genericon genericon-previous"></div>
  201. <div alt="f431" class="genericon genericon-expand"></div>
  202. <div alt="f432" class="genericon genericon-collapse"></div>
  203. <div alt="f433" class="genericon genericon-dropdown"></div>
  204. <div alt="f434" class="genericon genericon-dropdown-left"></div>
  205. <div alt="f435" class="genericon genericon-top"></div>
  206. <div alt="f436" class="genericon genericon-draggable"></div>
  207. <div alt="f437" class="genericon genericon-phone"></div>
  208. <div alt="f438" class="genericon genericon-send-to-phone"></div>
  209. <div alt="f439" class="genericon genericon-plugin"></div>
  210. <div alt="f440" class="genericon genericon-cloud-download"></div>
  211. <div alt="f441" class="genericon genericon-cloud-upload"></div>
  212. <div alt="f442" class="genericon genericon-external"></div>
  213. <div alt="f443" class="genericon genericon-document"></div>
  214. <div alt="f444" class="genericon genericon-book"></div>
  215. <div alt="f445" class="genericon genericon-cog"></div>
  216. <div alt="f446" class="genericon genericon-unapprove"></div>
  217. <div alt="f447" class="genericon genericon-cart"></div>
  218. <div alt="f448" class="genericon genericon-pause"></div>
  219. <div alt="f449" class="genericon genericon-stop"></div>
  220. <div alt="f450" class="genericon genericon-skip-back"></div>
  221. <div alt="f451" class="genericon genericon-skip-ahead"></div>
  222. <div alt="f452" class="genericon genericon-play"></div>
  223. <div alt="f453" class="genericon genericon-tablet"></div>
  224. <div alt="f454" class="genericon genericon-send-to-tablet"></div>
  225. <div alt="f455" class="genericon genericon-info"></div>
  226. <div alt="f456" class="genericon genericon-notice"></div>
  227. <div alt="f457" class="genericon genericon-help"></div>
  228. <div alt="f458" class="genericon genericon-fastforward"></div>
  229. <div alt="f459" class="genericon genericon-rewind"></div>
  230. <div alt="f460" class="genericon genericon-portfolio"></div>
  231. <div alt="f461" class="genericon genericon-heart"></div>
  232. <div alt="f462" class="genericon genericon-code"></div>
  233. <div alt="f463" class="genericon genericon-subscribe"></div>
  234. <div alt="f464" class="genericon genericon-unsubscribe"></div>
  235. <div alt="f465" class="genericon genericon-subscribed"></div>
  236. <div alt="f466" class="genericon genericon-reply-alt"></div>
  237. <div alt="f467" class="genericon genericon-reply-single"></div>
  238. <div alt="f468" class="genericon genericon-flag"></div>
  239. <div alt="f469" class="genericon genericon-print"></div>
  240. <div alt="f470" class="genericon genericon-lock"></div>
  241. <div alt="f471" class="genericon genericon-bold"></div>
  242. <div alt="f472" class="genericon genericon-italic"></div>
  243. <div alt="f473" class="genericon genericon-picture"></div>
  244. <!-- generic shapes -->
  245. <div alt="f500" class="genericon genericon-uparrow"></div>
  246. <div alt="f501" class="genericon genericon-rightarrow"></div>
  247. <div alt="f502" class="genericon genericon-downarrow"></div>
  248. <div alt="f503" class="genericon genericon-leftarrow"></div>
  249. </div>
  250. <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>
  251. <p><textarea class="code" style="min-height: 150px;" onclick="select();">.my-icon:before {
  252. content: '\f408';
  253. display: inline-block;
  254. -webkit-font-smoothing: antialiased;
  255. font: normal 32px/1 'Genericons';
  256. vertical-align: middle;
  257. }</textarea></p>
  258. <p>Add a matching class to your HTML:</p>
  259. <p><code>&lt;div class="my-icon"&gt;You're a Star!&lt;/div&gt;</code></p>
  260. <p>Here's the result: <span class="my-icon">You're a Star!</span></p>
  261. <h2>Examples</h2>
  262. <p>Turn every icon a <span style="color: #fa8072;">Salmon</span> color:</p>
  263. <p><textarea class="code" style="min-height: 70px" onclick="select();">
  264. .genericon {
  265. color: #fa8072;
  266. }</textarea></p>
  267. <p>Or turn the stars <span style="color: #ffd700;">Gold</span>:</p>
  268. <p><textarea class="code" style="min-height: 70px" onclick="select();">
  269. .genericon-star {
  270. color: #fa8072;
  271. }</textarea></p>
  272. <p>Use icons for bulleted lists:</p>
  273. <ul class="my-checklist">
  274. <li>One</li>
  275. <li>Two</li>
  276. <li>Three</li>
  277. <li>Four</li>
  278. </ul>
  279. <p><textarea class="code" style="min-height: 130px" onclick="select();">
  280. <ul class="my-checklist">
  281. <li>One</li>
  282. <li>Two</li>
  283. <li>Three</li>
  284. <li>Four</li>
  285. </ul></textarea></p>
  286. <p><textarea class="code" style="min-height: 260px;" onclick="select();">
  287. .my-checklist {
  288. list-style-type: none;
  289. text-indent: -16px;
  290. }
  291. .my-checklist li:before {
  292. padding-right: 16px;
  293. content: '\f418';
  294. display: inline-block;
  295. -webkit-font-smoothing: antialiased;
  296. font: normal 16px/1 'Genericons';
  297. vertical-align: text-top;
  298. }</textarea></p>
  299. <p>Use icons to style blockquotes:</p>
  300. <blockquote class="my-blockquote">Sometimes I've believed as many as six impossible things before breakfast. &mdash;<em>Lewis Carroll</em></blockquote>
  301. <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>
  302. <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>
  303. <p><textarea class="code" style="min-height: 300px;" onclick="select();">
  304. .my-blockquote {
  305. background: #eee;
  306. border-left: 32px solid #ddd;
  307. padding: 10px;
  308. }
  309. .my-blockquote:before {
  310. margin-left: -42px;
  311. padding-right: 10px;
  312. content: '\f106';
  313. display: inline-block;
  314. -webkit-font-smoothing: antialiased;
  315. font: normal 32px/20px 'Genericons';
  316. vertical-align: bottom;
  317. } </textarea></p>
  318. <p>Use icons to style buttons:</p>
  319. <a class="my-button" href="javascript:void()"><i class="genericon genericon-show"></i> View</a>
  320. <a class="my-button" href="javascript:void()"><i class="genericon genericon-audio"></i> Listen</a>
  321. <p><textarea class="code" style="min-height: 40px;" onclick="select();"><a class="my-button" href="#"><i class="genericon genericon-show"></i> View</a>
  322. <a class="my-button" href="#"><i class="genericon genericon-audio"></i> Listen</a></textarea></p>
  323. <p><textarea class="code" style="min-height: 300px;" onclick="select();">
  324. .my-button {
  325. font-family: Helvetica, sans-serif;
  326. background: #e05d22; /* Old browsers */
  327. background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome10+,Safari5.1+ */
  328. background: -moz-linear-gradient( top, #e05d22 0%, #d94412 100%); /* FF3.6+ */
  329. background: -ms-linear-gradient( top, #e05d22 0%, #d94412 100%); /* IE10+ */
  330. background: -o-linear-gradient( top, #e05d22 0%, #d94412 100%); /* Opera 11.10+ */
  331. background: linear-gradient( to bottom, #e05d22 0%, #d94412 100%); /* W3C */
  332. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e05d22', endColorstr='#d94412', GradientType=0); /* IE6-9 */
  333. display: inline-block;
  334. padding: 10px 16px 6px 16px;
  335. color: #fff;
  336. text-decoration: none;
  337. border: none;
  338. border-bottom: 3px solid #b93207;
  339. border-radius: 2px;
  340. }
  341. .my-button:hover,
  342. .my-button:focus {
  343. background: #ed6a31; /* Old browsers */
  344. background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome10+,Safari5.1+ */
  345. background: -moz-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* FF3.6+ */
  346. background: -ms-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* IE10+ */
  347. background: -o-linear-gradient( top, #ed6a31 0%, #e55627 100%); /* Opera 11.10+ */
  348. background: linear-gradient( to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
  349. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ed6a31', endColorstr='#e55627', GradientType=0); /* IE6-9 */
  350. outline: none;
  351. }
  352. .my-button:active {
  353. background: #d94412; /* Old browsers */
  354. background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome10+,Safari5.1+ */
  355. background: -moz-linear-gradient( top, #d94412 0%, #e05d22 100%); /* FF3.6+ */
  356. background: -ms-linear-gradient( top, #d94412 0%, #e05d22 100%); /* IE10+ */
  357. background: -o-linear-gradient( top, #d94412 0%, #e05d22 100%); /* Opera 11.10+ */
  358. background: linear-gradient( to bottom, #d94412 0%, #e05d22 100%); /* W3C */
  359. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#d94412', endColorstr='#e05d22', GradientType=0); /* IE6-9 */
  360. border: none;
  361. border-top: 3px solid #b93207;
  362. padding: 6px 16px 10px 16px;
  363. }</textarea>/</p>
  364. <h2>CSS Preprocessors</h2>
  365. <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>
  366. <p>This example will seup the basic genericon rules and sets a color you can use for all icons using Sass:</p>
  367. <p><textarea class="code" style="min-height: 360px;" onclick="select();">$icon-color: "#fa8072";
  368. .genericon {
  369. color: $icon-color;
  370. }
  371. @mixin genericon-rules {
  372. display: inline-block;
  373. -webkit-font-smoothing: antialiased;
  374. font: normal 16px/1 'Genericons';
  375. vertical-align: middle;
  376. }
  377. .my-icon:before {
  378. content: '\f408';
  379. @include genericon-rules;
  380. }</textarea></p>
  381. <p>Here is a similar example for LESS:</p>
  382. <p><textarea class="code" style="min-height: 360px;" onclick="select();">@icon-color: "#fa8072";
  383. .genericon {
  384. color: @icon-color;
  385. }
  386. .genericon-rules {
  387. display: inline-block;
  388. -webkit-font-smoothing: antialiased;
  389. font: normal 16px/1 'Genericons';
  390. vertical-align: middle;
  391. }
  392. .my-icon:before {
  393. content: '\f408';
  394. .genericon-rules;
  395. }</textarea></p>
  396. <h2>Fallback images for IE7 and below</h2>
  397. <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:
  398. <p><code>&lt;span class="genericon genericon-warning"&gt;&lt;/span&gt;</code></p>
  399. <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>
  400. <textarea class="code" style="min-height: 85px;" onclick="select();">.genericon-warning {
  401. *background: url(fallback-icon.png) no-repeat center center;
  402. *text-indent: 100%;
  403. }</textarea>
  404. </div>
  405. </body>
  406. </html>