jetpack-fonts.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. <?php
  2. add_filter( 'typekit_add_font_category_rules', function( $category_rules ) {
  3. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  4. 'b,
  5. strong',
  6. array(
  7. array( 'property' => 'font-weight', 'value' => 'bold' ),
  8. )
  9. );
  10. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  11. 'dfn',
  12. array(
  13. array( 'property' => 'font-style', 'value' => 'italic' ),
  14. )
  15. );
  16. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  17. 'optgroup',
  18. array(
  19. array( 'property' => 'font-weight', 'value' => 'bold' ),
  20. )
  21. );
  22. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  23. 'body,
  24. button,
  25. input,
  26. select,
  27. textarea',
  28. array(
  29. array( 'property' => 'font-family', 'value' => 'Lora, serif' ),
  30. array( 'property' => 'font-size', 'value' => '16px' ),
  31. )
  32. );
  33. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  34. 'h1,
  35. h2:not(.author-title),
  36. h3,
  37. h4,
  38. h5,
  39. h6',
  40. array(
  41. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  42. array( 'property' => 'font-weight', 'value' => '900' ),
  43. )
  44. );
  45. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  46. 'h1',
  47. array(
  48. array( 'property' => 'font-size', 'value' => '49px' ),
  49. )
  50. );
  51. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  52. 'h2:not(.author-title)',
  53. array(
  54. array( 'property' => 'font-size', 'value' => '39px' ),
  55. )
  56. );
  57. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  58. 'h3',
  59. array(
  60. array( 'property' => 'font-size', 'value' => '31px' ),
  61. )
  62. );
  63. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  64. 'h4',
  65. array(
  66. array( 'property' => 'font-size', 'value' => '25px' ),
  67. )
  68. );
  69. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  70. 'h5',
  71. array(
  72. array( 'property' => 'font-size', 'value' => '20px' ),
  73. )
  74. );
  75. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  76. 'h6',
  77. array(
  78. array( 'property' => 'font-size', 'value' => '16px' ),
  79. )
  80. );
  81. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  82. 'cite,
  83. dfn,
  84. em,
  85. i',
  86. array(
  87. array( 'property' => 'font-style', 'value' => 'italic' ),
  88. )
  89. );
  90. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  91. 'blockquote',
  92. array(
  93. array( 'property' => 'font-style', 'value' => 'italic' ),
  94. )
  95. );
  96. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  97. 'cite',
  98. array(
  99. array( 'property' => 'font-size', 'value' => '16px' ),
  100. )
  101. );
  102. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  103. 'dt',
  104. array(
  105. array( 'property' => 'font-weight', 'value' => 'bold' ),
  106. )
  107. );
  108. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  109. 'a',
  110. array(
  111. array( 'property' => 'font-weight', 'value' => 'bold' ),
  112. )
  113. );
  114. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  115. 'a:visited',
  116. array(
  117. array( 'property' => 'font-weight', 'value' => 'normal' ),
  118. )
  119. );
  120. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  121. '.main-navigation',
  122. array(
  123. array( 'property' => 'font-size', 'value' => '16px' ),
  124. )
  125. );
  126. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  127. '.comment-navigation a,
  128. .posts-navigation a',
  129. array(
  130. array( 'property' => 'font-size', 'value' => '16px' ),
  131. )
  132. );
  133. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  134. '.post-navigation .post-title',
  135. array(
  136. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  137. array( 'property' => 'font-size', 'value' => '25px' ),
  138. array( 'property' => 'font-weight', 'value' => '900' ),
  139. )
  140. );
  141. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  142. '.widget',
  143. array(
  144. array( 'property' => 'font-size', 'value' => '16px' ),
  145. )
  146. );
  147. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  148. '.widget-title,
  149. .widgettitle',
  150. array(
  151. array( 'property' => 'font-size', 'value' => '25px' ),
  152. )
  153. );
  154. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  155. '.widget_recent_entries .post-date',
  156. array(
  157. array( 'property' => 'font-size', 'value' => '13px' ),
  158. )
  159. );
  160. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  161. '.widget_rss .rss-date,
  162. .widget_rss cite',
  163. array(
  164. array( 'property' => 'font-size', 'value' => '13px' ),
  165. )
  166. );
  167. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  168. '.site-title',
  169. array(
  170. array( 'property' => 'font-size', 'value' => '16px' ),
  171. )
  172. );
  173. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  174. '.site-footer',
  175. array(
  176. array( 'property' => 'font-size', 'value' => '16px' ),
  177. )
  178. );
  179. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  180. '.site-info',
  181. array(
  182. array( 'property' => 'font-size', 'value' => '13px' ),
  183. )
  184. );
  185. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  186. '.site-info .sep',
  187. array(
  188. array( 'property' => 'font-size', 'value' => '16px' ),
  189. )
  190. );
  191. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  192. '.featured-content .entry-title',
  193. array(
  194. array( 'property' => 'font-size', 'value' => '25px' ),
  195. )
  196. );
  197. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  198. '.entry-summary',
  199. array(
  200. array( 'property' => 'font-size', 'value' => '16px' ),
  201. )
  202. );
  203. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  204. '.page-title',
  205. array(
  206. array( 'property' => 'font-size', 'value' => '39px' ),
  207. )
  208. );
  209. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  210. '.archive .hentry .entry-title,
  211. .blog .hentry .entry-title,
  212. .search .hentry .entry-title',
  213. array(
  214. array( 'property' => 'font-size', 'value' => '25px' ),
  215. )
  216. );
  217. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  218. '.page .entry-title,
  219. .single .entry-title',
  220. array(
  221. array( 'property' => 'font-size', 'value' => '39px' ),
  222. )
  223. );
  224. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  225. '.entry-meta',
  226. array(
  227. array( 'property' => 'font-size', 'value' => '13px' ),
  228. )
  229. );
  230. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  231. '.entry-footer',
  232. array(
  233. array( 'property' => 'font-size', 'value' => '13px' ),
  234. )
  235. );
  236. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  237. '.page-links',
  238. array(
  239. array( 'property' => 'font-size', 'value' => '13px' ),
  240. )
  241. );
  242. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  243. '.author-info .author-name',
  244. array(
  245. array( 'property' => 'font-size', 'value' => '25px' ),
  246. )
  247. );
  248. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  249. '.author-info .author-bio',
  250. array(
  251. array( 'property' => 'font-size', 'value' => '16px' ),
  252. )
  253. );
  254. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  255. '.comments-area',
  256. array(
  257. array( 'property' => 'font-size', 'value' => '16px' ),
  258. )
  259. );
  260. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  261. '.comment-reply-title,
  262. .comments-title,
  263. .no-comments',
  264. array(
  265. array( 'property' => 'font-size', 'value' => '25px' ),
  266. )
  267. );
  268. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  269. '.no-comments',
  270. array(
  271. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  272. array( 'property' => 'font-weight', 'value' => '900' ),
  273. )
  274. );
  275. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  276. '.comment-form,
  277. .comment-form code',
  278. array(
  279. array( 'property' => 'font-size', 'value' => '16px' ),
  280. )
  281. );
  282. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  283. '.comment-content blockquote:before',
  284. array(
  285. array( 'property' => 'font-size', 'value' => '16px' ),
  286. )
  287. );
  288. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  289. '.comment-author',
  290. array(
  291. array( 'property' => 'font-size', 'value' => '16px' ),
  292. )
  293. );
  294. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  295. '.comment-author a,
  296. .comment-author b',
  297. array(
  298. array( 'property' => 'font-weight', 'value' => '900' ),
  299. )
  300. );
  301. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  302. '.comment-metadata .edit-link:before',
  303. array(
  304. array( 'property' => 'font-weight', 'value' => 'bold' ),
  305. )
  306. );
  307. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  308. '.comment-list .comment-reply-title small,
  309. .comment-metadata,
  310. .comment-reply-link',
  311. array(
  312. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  313. array( 'property' => 'font-weight', 'value' => 'bold' ),
  314. )
  315. );
  316. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  317. '.comment-list .comment-reply-title small,
  318. .comment-metadata,
  319. .comment-reply-link',
  320. array(
  321. array( 'property' => 'font-size', 'value' => '13px' ),
  322. )
  323. );
  324. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  325. '.required',
  326. array(
  327. array( 'property' => 'font-weight', 'value' => 'bold' ),
  328. )
  329. );
  330. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  331. '.wp-caption',
  332. array(
  333. array( 'property' => 'font-size', 'value' => '16px' ),
  334. )
  335. );
  336. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  337. '.gallery-caption',
  338. array(
  339. array( 'property' => 'font-size', 'value' => '16px' ),
  340. )
  341. );
  342. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  343. '#infinite-handle span button,
  344. #infinite-handle span button:active,
  345. #infinite-handle span button:focus,
  346. #infinite-handle span button:hover',
  347. array(
  348. array( 'property' => 'font-size', 'value' => '16px' ),
  349. )
  350. );
  351. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  352. '#infinite-footer',
  353. array(
  354. array( 'property' => 'font-size', 'value' => '13px' ),
  355. )
  356. );
  357. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  358. '.hentry div.sd-rating h3.sd-title,
  359. .hentry div.sharedaddy h3.sd-title',
  360. array(
  361. array( 'property' => 'font-size', 'value' => '13px' ),
  362. )
  363. );
  364. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  365. '.hentry div#jp-relatedposts h3.jp-relatedposts-headline',
  366. array(
  367. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  368. array( 'property' => 'font-size', 'value' => '25px' ),
  369. array( 'property' => 'font-weight', 'value' => '900' ),
  370. )
  371. );
  372. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  373. '.hentry div#jp-relatedposts div.jp-relatedposts-items p',
  374. array(
  375. array( 'property' => 'font-size', 'value' => '16px' ),
  376. )
  377. );
  378. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  379. '.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post-context',
  380. array(
  381. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  382. array( 'property' => 'font-weight', 'value' => 'bold' ),
  383. )
  384. );
  385. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  386. '.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post-context',
  387. array(
  388. array( 'property' => 'font-size', 'value' => '13px' ),
  389. )
  390. );
  391. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  392. '.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post-title',
  393. array(
  394. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  395. array( 'property' => 'font-weight', 'value' => 'bold' ),
  396. )
  397. );
  398. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  399. '.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post-title',
  400. array(
  401. array( 'property' => 'font-size', 'value' => '16px' ),
  402. )
  403. );
  404. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  405. '.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4',
  406. array(
  407. array( 'property' => 'font-size', 'value' => '20px' ),
  408. )
  409. );
  410. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  411. '.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p',
  412. array(
  413. array( 'property' => 'font-size', 'value' => '16px' ),
  414. )
  415. );
  416. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  417. '.widget_goodreads h2[class^="gr_custom_header"]',
  418. array(
  419. array( 'property' => 'font-size', 'value' => '20px' ),
  420. )
  421. );
  422. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  423. '.widget_goodreads div[class^="gr_custom_title"]',
  424. array(
  425. array( 'property' => 'font-weight', 'value' => 'bold' ),
  426. )
  427. );
  428. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  429. '.widget_goodreads div[class^="gr_custom_author"]',
  430. array(
  431. array( 'property' => 'font-size', 'value' => '13px' ),
  432. )
  433. );
  434. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  435. '.widget-grofile h4',
  436. array(
  437. array( 'property' => 'font-size', 'value' => '20px' ),
  438. )
  439. );
  440. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  441. 'body',
  442. array(
  443. array( 'property' => 'font-size', 'value' => '20px' ),
  444. ),
  445. array(
  446. 'screen and (min-width: 768px)',
  447. )
  448. );
  449. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  450. '.site-title',
  451. array(
  452. array( 'property' => 'font-size', 'value' => '20px' ),
  453. ),
  454. array(
  455. 'screen and (min-width: 768px)',
  456. )
  457. );
  458. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  459. 'body .hentry .wpcom-reblog-snapshot .reblogger-note-content blockquote',
  460. array(
  461. array( 'property' => 'font-style', 'value' => 'italic' ),
  462. )
  463. );
  464. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  465. '.aboutme_widget #am_name',
  466. array(
  467. array( 'property' => 'font-size', 'value' => '25px' ),
  468. )
  469. );
  470. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  471. '.aboutme_widget #am_headline',
  472. array(
  473. array( 'property' => 'font-size', 'value' => '20px' ),
  474. )
  475. );
  476. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  477. '.widget_akismet_widget .a-stats',
  478. array(
  479. array( 'property' => 'font-size', 'value' => '14px' ),
  480. )
  481. );
  482. return $category_rules;
  483. } );