jetpack-fonts.php 12 KB

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