jetpack-fonts.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <?php
  2. add_filter( 'typekit_add_font_category_rules', function( $category_rules ) {
  3. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  4. 'body,
  5. button,
  6. input,
  7. select,
  8. textarea',
  9. array(
  10. array( 'property' => 'font-family', 'value' => 'Lato, Helvetica, sans-serif' ),
  11. array( 'property' => 'font-size', 'value' => '16px' ),
  12. )
  13. );
  14. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  15. 'h1,
  16. h2,
  17. h3,
  18. h4,
  19. h5,
  20. h6',
  21. array(
  22. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  23. array( 'property' => 'font-style', 'value' => 'italic' ),
  24. array( 'property' => 'font-weight', 'value' => 'normal' ),
  25. )
  26. );
  27. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  28. 'cite,
  29. dfn,
  30. em,
  31. i',
  32. array(
  33. array( 'property' => 'font-style', 'value' => 'italic' ),
  34. )
  35. );
  36. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  37. 'pre',
  38. array(
  39. array( 'property' => 'font-family', 'value' => '"Courier 10 Pitch", Courier, monospace' ),
  40. array( 'property' => 'font-size', 'value' => '15px' ),
  41. )
  42. );
  43. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  44. 'code,
  45. kbd,
  46. tt,
  47. var',
  48. array(
  49. array( 'property' => 'font-family', 'value' => 'Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace' ),
  50. array( 'property' => 'font-size', 'value' => '15px' ),
  51. )
  52. );
  53. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  54. 'big',
  55. array(
  56. array( 'property' => 'font-size', 'value' => '125%' ),
  57. )
  58. );
  59. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  60. 'blockquote,
  61. q',
  62. array(
  63. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  64. array( 'property' => 'font-style', 'value' => 'italic' ),
  65. array( 'property' => 'font-size', 'value' => '1.25em' ),
  66. )
  67. );
  68. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  69. 'blockquote blockquote,
  70. q blockquote',
  71. array(
  72. array( 'property' => 'font-size', 'value' => 'inherit' ),
  73. )
  74. );
  75. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  76. 'dt',
  77. array(
  78. array( 'property' => 'font-weight', 'value' => 'bold' ),
  79. )
  80. );
  81. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  82. '#infinite-handle span button,
  83. button,
  84. input[type="button"],
  85. input[type="reset"],
  86. input[type="submit"]',
  87. array(
  88. array( 'property' => 'font-size', 'value' => '0.9em' ),
  89. array( 'property' => 'font-weight', 'value' => 'bold' ),
  90. )
  91. );
  92. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  93. '#infinite-handle span button:hover,
  94. #infinite-handle span:hover button',
  95. array(
  96. array( 'property' => 'font-size', 'value' => '13px' ),
  97. array( 'property' => 'font-weight', 'value' => 'bold' ),
  98. )
  99. );
  100. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  101. '.main-navigation',
  102. array(
  103. array( 'property' => 'font-size', 'value' => '13px' ),
  104. array( 'property' => 'font-weight', 'value' => 'bold' ),
  105. )
  106. );
  107. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  108. '.menu-toggle',
  109. array(
  110. array( 'property' => 'font-size', 'value' => '1em' ),
  111. )
  112. );
  113. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  114. '.comment-navigation,
  115. .post-navigation,
  116. .posts-navigation',
  117. array(
  118. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  119. array( 'property' => 'font-style', 'value' => 'italic' ),
  120. array( 'property' => 'font-weight', 'value' => 'bold' ),
  121. )
  122. );
  123. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  124. '.comment-navigation .nav-previous,
  125. .post-navigation .nav-previous,
  126. .posts-navigation .nav-previous',
  127. array(
  128. array( 'property' => 'font-size', 'value' => '1.25em' ),
  129. )
  130. );
  131. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  132. '.comment-navigation .nav-next,
  133. .post-navigation .nav-next,
  134. .posts-navigation .nav-next',
  135. array(
  136. array( 'property' => 'font-size', 'value' => '1.25em' ),
  137. )
  138. );
  139. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  140. '.comment-navigation .meta-nav,
  141. .post-navigation .meta-nav,
  142. .posts-navigation .meta-nav',
  143. array(
  144. array( 'property' => 'font-family', 'value' => 'Lato, Helvetica, sans-serif' ),
  145. array( 'property' => 'font-size', 'value' => '13px' ),
  146. array( 'property' => 'font-style', 'value' => 'normal' ),
  147. )
  148. );
  149. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  150. '.social-links ul a:before',
  151. array(
  152. array( 'property' => 'font-family', 'value' => '"Genericons"' ),
  153. array( 'property' => 'font-size', 'value' => '24px' ),
  154. array( 'property' => 'font-style', 'value' => 'normal' ),
  155. array( 'property' => 'font-weight', 'value' => 'normal' ),
  156. )
  157. );
  158. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  159. '.social-links ul a:before',
  160. array(
  161. array( 'property' => 'font-size', 'value' => '24px' ),
  162. )
  163. );
  164. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  165. '.screen-reader-text:active,
  166. .screen-reader-text:focus,
  167. .screen-reader-text:hover',
  168. array(
  169. array( 'property' => 'font-size', 'value' => '14px' ),
  170. array( 'property' => 'font-weight', 'value' => 'bold' ),
  171. )
  172. );
  173. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  174. '.widget',
  175. array(
  176. array( 'property' => 'font-size', 'value' => '14px' ),
  177. )
  178. );
  179. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  180. '.widget-title',
  181. array(
  182. array( 'property' => 'font-style', 'value' => 'italic' ),
  183. array( 'property' => 'font-size', 'value' => '1.25em' ),
  184. )
  185. );
  186. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  187. '.rating-msg',
  188. array(
  189. array( 'property' => 'font-size', 'value' => '18px' ),
  190. )
  191. );
  192. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  193. '.widget_rss cite',
  194. array(
  195. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  196. )
  197. );
  198. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  199. '.site-title',
  200. array(
  201. array( 'property' => 'font-style', 'value' => 'italic' ),
  202. array( 'property' => 'font-weight', 'value' => 'bold' ),
  203. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  204. )
  205. );
  206. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  207. '.site-title',
  208. array(
  209. array( 'property' => 'font-size', 'value' => '3.052em' ),
  210. ),
  211. array( 'only screen and (min-width: 40.063em)')
  212. );
  213. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  214. '.site-description',
  215. array(
  216. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  217. array( 'property' => 'font-size', 'value' => '1.25em' ),
  218. array( 'property' => 'font-style', 'value' => 'italic' ),
  219. )
  220. );
  221. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  222. '.format-link .entry-title a:after',
  223. array(
  224. array( 'property' => 'font-size', 'value' => '32px' ),
  225. array( 'property' => 'font-family', 'value' => '"Genericons"' ),
  226. array( 'property' => 'font-style', 'value' => 'normal' ),
  227. array( 'property' => 'font-weight', 'value' => 'normal' ),
  228. array( 'property' => 'font-variant', 'value' => 'normal' ),
  229. )
  230. );
  231. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  232. '.entry-footer,
  233. .entry-meta',
  234. array(
  235. array( 'property' => 'font-size', 'value' => '14px' ),
  236. )
  237. );
  238. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  239. '.cat-links',
  240. array(
  241. array( 'property' => 'font-size', 'value' => '13px' ),
  242. array( 'property' => 'font-weight', 'value' => 'bold' ),
  243. )
  244. );
  245. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  246. '.tags-links a,
  247. .tags-links a:visited,
  248. .widget_tag_cloud a,
  249. .widget_tag_cloud a:visited',
  250. array(
  251. array( 'property' => 'font-weight', 'value' => 'bold' ),
  252. array( 'property' => 'font-size', 'value' => '13px' ),
  253. )
  254. );
  255. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  256. '.widget_tag_cloud a',
  257. array(
  258. array( 'property' => 'font-size', 'value' => '0.9em !important' ),
  259. )
  260. );
  261. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  262. 'a.more-link',
  263. array(
  264. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  265. array( 'property' => 'font-weight', 'value' => 'bold' ),
  266. array( 'property' => 'font-style', 'value' => 'italic' ),
  267. )
  268. );
  269. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  270. 'h1',
  271. array(
  272. array( 'property' => 'font-style', 'value' => 'italic' ),
  273. array( 'property' => 'font-size', 'value' => '3.052em' ),
  274. )
  275. );
  276. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  277. 'h2,
  278. .site-title',
  279. array(
  280. array( 'property' => 'font-size', 'value' => '2.441em' ),
  281. )
  282. );
  283. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  284. '.entry-title',
  285. array(
  286. array( 'property' => 'font-size', 'value' => '1.953em' ),
  287. ),
  288. array( 'only screen and (min-width: 40.063em)' )
  289. );
  290. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  291. 'h3',
  292. array(
  293. array( 'property' => 'font-size', 'value' => '1.995em' ),
  294. )
  295. );
  296. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  297. '.entry-title,
  298. h4',
  299. array(
  300. array( 'property' => 'font-size', 'value' => '1.563em' ),
  301. )
  302. );
  303. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  304. 'h5',
  305. array(
  306. array( 'property' => 'font-size', 'value' => '1.25em' ),
  307. )
  308. );
  309. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  310. 'h6',
  311. array(
  312. array( 'property' => 'font-size', 'value' => '1em' ),
  313. )
  314. );
  315. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  316. '.page-title',
  317. array(
  318. array( 'property' => 'font-size', 'value' => '1.563em' ),
  319. )
  320. );
  321. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  322. '.site-footer',
  323. array(
  324. array( 'property' => 'font-size', 'value' => '0.8em' ),
  325. array( 'property' => 'font-weight', 'value' => 'bold' ),
  326. )
  327. );
  328. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  329. '.comment-meta .comment-metadata',
  330. array(
  331. array( 'property' => 'font-size', 'value' => '13px' ),
  332. array( 'property' => 'font-weight', 'value' => 'bold' ),
  333. )
  334. );
  335. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  336. '.comment-meta .comment-author .fn',
  337. array(
  338. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  339. array( 'property' => 'font-size', 'value' => '1.25em' ),
  340. array( 'property' => 'font-weight', 'value' => 'normal' ),
  341. array( 'property' => 'font-style', 'value' => 'italic' ),
  342. )
  343. );
  344. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  345. '.comment-form-author label,
  346. .comment-form-comment label,
  347. .comment-form-email label,
  348. .comment-form-url label',
  349. array(
  350. array( 'property' => 'font-size', 'value' => '13px' ),
  351. array( 'property' => 'font-weight', 'value' => 'bold' ),
  352. )
  353. );
  354. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  355. '.no-comments',
  356. array(
  357. array( 'property' => 'font-style', 'value' => 'italic' ),
  358. )
  359. );
  360. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  361. '#infinite-footer .container',
  362. array(
  363. array( 'property' => 'font-style', 'value' => 'italic' ),
  364. )
  365. );
  366. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  367. '#infinite-footer .blog-credits,
  368. #infinite-footer .blog-info a',
  369. array(
  370. array( 'property' => 'font-style', 'value' => 'normal' ),
  371. array( 'property' => 'font-weight', 'value' => 'bold' ),
  372. )
  373. );
  374. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  375. '.wp-caption-text',
  376. array(
  377. array( 'property' => 'font-family', 'value' => 'Lora, Garamond, serif' ),
  378. array( 'property' => 'font-style', 'value' => 'italic' ),
  379. )
  380. );
  381. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  382. '.main-navigation li.menu-item-has-children > a:before,
  383. .main-navigation li.page_item_has_children > a:before',
  384. array(
  385. array( 'property' => 'font-size', 'value' => '16px' ),
  386. array( 'property' => 'font-style', 'value' => 'normal' ),
  387. array( 'property' => 'font-weight', 'value' => 'normal' ),
  388. array( 'property' => 'font-variant', 'value' => 'normal' ),
  389. )
  390. );
  391. return $category_rules;
  392. } );