jetpack-fonts.php 13 KB

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