jetpack-fonts.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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' => 'Lato, sans-serif' ),
  30. array( 'property' => 'font-size', 'value' => '16px' ),
  31. )
  32. );
  33. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  34. '.site-description,
  35. .site-title,
  36. h1,
  37. h2:not(.author-title),
  38. h3,
  39. h4,
  40. h5,
  41. h6',
  42. array(
  43. array( 'property' => 'font-family', 'value' => 'Neuton, serif' ),
  44. array( 'property' => 'font-weight', 'value' => 'normal' ),
  45. )
  46. );
  47. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  48. 'h1',
  49. array(
  50. array( 'property' => 'font-size', 'value' => '40px' ),
  51. )
  52. );
  53. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  54. '.entry-title,
  55. h2',
  56. array(
  57. array( 'property' => 'font-size', 'value' => '32px' ),
  58. )
  59. );
  60. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  61. '.comments-title,
  62. .site-title,
  63. .widget-title,
  64. h3',
  65. array(
  66. array( 'property' => 'font-size', 'value' => '25px' ),
  67. )
  68. );
  69. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  70. '.page-title,
  71. h4',
  72. array(
  73. array( 'property' => 'font-size', 'value' => '20px' ),
  74. )
  75. );
  76. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  77. 'h5',
  78. array(
  79. array( 'property' => 'font-size', 'value' => '16px' ),
  80. )
  81. );
  82. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  83. '.site-description,
  84. h6',
  85. array(
  86. array( 'property' => 'font-size', 'value' => '13px' ),
  87. )
  88. );
  89. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  90. 'cite,
  91. dfn,
  92. em,
  93. i',
  94. array(
  95. array( 'property' => 'font-style', 'value' => 'italic' ),
  96. )
  97. );
  98. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  99. 'blockquote',
  100. array(
  101. array( 'property' => 'font-family', 'value' => 'Neuton, serif' ),
  102. array( 'property' => 'font-style', 'value' => 'italic' ),
  103. )
  104. );
  105. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  106. 'blockquote',
  107. array(
  108. array( 'property' => 'font-size', 'value' => '20px' ),
  109. )
  110. );
  111. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  112. 'cite',
  113. array(
  114. array( 'property' => 'font-weight', 'value' => 'bold' ),
  115. )
  116. );
  117. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  118. 'dt',
  119. array(
  120. array( 'property' => 'font-weight', 'value' => 'bold' ),
  121. )
  122. );
  123. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  124. 'caption,
  125. th',
  126. array(
  127. array( 'property' => 'font-weight', 'value' => 'bold' ),
  128. )
  129. );
  130. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  131. 'button,
  132. input[type="button"],
  133. input[type="reset"],
  134. input[type="submit"]',
  135. array(
  136. array( 'property' => 'font-weight', 'value' => 'bold' ),
  137. )
  138. );
  139. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  140. '.meta-nav',
  141. array(
  142. array( 'property' => 'font-size', 'value' => '13px' ),
  143. )
  144. );
  145. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  146. '.post-navigation .post-title',
  147. array(
  148. array( 'property' => 'font-family', 'value' => 'Neuton, serif' ),
  149. array( 'property' => 'font-weight', 'value' => 'normal' ),
  150. )
  151. );
  152. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  153. '.post-navigation .post-title',
  154. array(
  155. array( 'property' => 'font-size', 'value' => '25px' ),
  156. )
  157. );
  158. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  159. '.widget_recent_entries .post-date',
  160. array(
  161. array( 'property' => 'font-size', 'value' => '13px' ),
  162. )
  163. );
  164. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  165. '.widget_rss .rss-date,
  166. .widget_rss cite',
  167. array(
  168. array( 'property' => 'font-size', 'value' => '13px' ),
  169. )
  170. );
  171. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  172. '.site-info',
  173. array(
  174. array( 'property' => 'font-size', 'value' => '13px' ),
  175. )
  176. );
  177. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  178. '.entry-meta',
  179. array(
  180. array( 'property' => 'font-size', 'value' => '13px' ),
  181. )
  182. );
  183. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  184. '.page-links > span,
  185. .page-links a',
  186. array(
  187. array( 'property' => 'font-weight', 'value' => 'bold' ),
  188. )
  189. );
  190. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  191. '.page-links > .page-links-title',
  192. array(
  193. array( 'property' => 'font-size', 'value' => '13px' ),
  194. )
  195. );
  196. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  197. '.entry-footer',
  198. array(
  199. array( 'property' => 'font-size', 'value' => '13px' ),
  200. )
  201. );
  202. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  203. '.author-title',
  204. array(
  205. array( 'property' => 'font-size', 'value' => '13px' ),
  206. )
  207. );
  208. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  209. '.no-comments',
  210. array(
  211. array( 'property' => 'font-family', 'value' => 'Neuton, serif' ),
  212. array( 'property' => 'font-size', 'value' => '25px' ),
  213. )
  214. );
  215. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  216. '.comment-author',
  217. array(
  218. array( 'property' => 'font-family', 'value' => 'Neuton, serif' ),
  219. array( 'property' => 'font-size', 'value' => '20px' ),
  220. )
  221. );
  222. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  223. '.comment-author a,
  224. .comment-author b',
  225. array(
  226. array( 'property' => 'font-weight', 'value' => 'normal' ),
  227. )
  228. );
  229. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  230. '.comment-metadata',
  231. array(
  232. array( 'property' => 'font-size', 'value' => '13px' ),
  233. )
  234. );
  235. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  236. '.comment-form-author,
  237. .comment-form-comment,
  238. .comment-form-email,
  239. .comment-form-url',
  240. array(
  241. array( 'property' => 'font-size', 'value' => '13px' ),
  242. )
  243. );
  244. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  245. '.form-allowed-tags',
  246. array(
  247. array( 'property' => 'font-size', 'value' => '13px' ),
  248. )
  249. );
  250. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  251. '.wp-caption',
  252. array(
  253. array( 'property' => 'font-size', 'value' => '13px' ),
  254. )
  255. );
  256. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  257. '.gallery-caption',
  258. array(
  259. array( 'property' => 'font-size', 'value' => '13px' ),
  260. )
  261. );
  262. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  263. '.site-content .contact-form label',
  264. array(
  265. array( 'property' => 'font-size', 'value' => '13px' ),
  266. )
  267. );
  268. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  269. '#infinite-footer .container',
  270. array(
  271. array( 'property' => 'font-size', 'value' => '13px' ),
  272. )
  273. );
  274. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  275. '#infinite-handle span',
  276. array(
  277. array( 'property' => 'font-size', 'value' => '13px' ),
  278. )
  279. );
  280. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  281. '.hentry div.sd-rating h3.sd-title,
  282. .hentry div.sharedaddy h3.sd-title',
  283. array(
  284. array( 'property' => 'font-size', 'value' => '13px' ),
  285. )
  286. );
  287. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  288. '.hentry div#jp-relatedposts h3.jp-relatedposts-headline',
  289. array(
  290. array( 'property' => 'font-size', 'value' => '13px' ),
  291. )
  292. );
  293. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  294. '.hentry div#jp-relatedposts div.jp-relatedposts-items p',
  295. array(
  296. array( 'property' => 'font-size', 'value' => '16px' ),
  297. )
  298. );
  299. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  300. '.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post-title',
  301. array(
  302. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  303. array( 'property' => 'font-size', 'value' => '16px' ),
  304. array( 'property' => 'font-weight', 'value' => 'bold' ),
  305. )
  306. );
  307. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  308. '.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4',
  309. array(
  310. array( 'property' => 'font-size', 'value' => '20px' ),
  311. )
  312. );
  313. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  314. '.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p',
  315. array(
  316. array( 'property' => 'font-size', 'value' => '16px' ),
  317. )
  318. );
  319. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  320. '.widget_goodreads h2[class^="gr_custom_header"]',
  321. array(
  322. array( 'property' => 'font-size', 'value' => '20px' ),
  323. )
  324. );
  325. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  326. '.widget_goodreads div[class^="gr_custom_title"]',
  327. array(
  328. array( 'property' => 'font-weight', 'value' => 'bold' ),
  329. )
  330. );
  331. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  332. '.widget_goodreads div[class^="gr_custom_author"]',
  333. array(
  334. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  335. array( 'property' => 'font-size', 'value' => '13px' ),
  336. )
  337. );
  338. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  339. '.widget-grofile h4',
  340. array(
  341. array( 'property' => 'font-size', 'value' => '20px' ),
  342. )
  343. );
  344. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  345. '.widget-grofile .grofile-full-link',
  346. array(
  347. array( 'property' => 'font-weight', 'value' => 'bold' ),
  348. )
  349. );
  350. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  351. '#comments #respond p.form-submit input#comment-submit,
  352. .widget_akismet_widget .a-stats,
  353. .widget_flickr #flickr_badge_uber_wrapper td a:last-child,
  354. .milestone-widget .milestone-header,
  355. .widget.top_rated .pd_top_rated_holder_posts > p',
  356. array(
  357. array( 'property' => 'font-family', 'value' => 'Lato, sans-serif' ),
  358. )
  359. );
  360. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  361. '.aboutme_widget #am_name',
  362. array(
  363. array( 'property' => 'font-size', 'value' => '25px' ),
  364. )
  365. );
  366. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  367. '.aboutme_widget #am_headline',
  368. array(
  369. array( 'property' => 'font-size', 'value' => '20px' ),
  370. )
  371. );
  372. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  373. '.widget_akismet_widget .a-stats a,
  374. .widget_akismet_widget .a-stats .count,
  375. .widget_flickr #flickr_badge_uber_wrapper td a:last-child',
  376. array(
  377. array( 'property' => 'font-weight', 'value' => 'bold' ),
  378. )
  379. );
  380. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  381. '.site-title',
  382. array(
  383. array( 'property' => 'font-size', 'value' => '49px' ),
  384. ),
  385. array(
  386. 'screen and (min-width: 768px)',
  387. )
  388. );
  389. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  390. '.page-title',
  391. array(
  392. array( 'property' => 'font-size', 'value' => '40px' ),
  393. ),
  394. array(
  395. 'screen and (min-width: 768px)',
  396. )
  397. );
  398. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  399. '.hero .entry-meta',
  400. array(
  401. array( 'property' => 'font-size', 'value' => '16px' ),
  402. ),
  403. array(
  404. 'screen and (min-width: 768px)',
  405. )
  406. );
  407. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  408. '.hero .entry-title',
  409. array(
  410. array( 'property' => 'font-size', 'value' => '62px' ),
  411. ),
  412. array(
  413. 'screen and (min-width: 768px)',
  414. )
  415. );
  416. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  417. '.hero .entry-summary',
  418. array(
  419. array( 'property' => 'font-size', 'value' => '20px' ),
  420. ),
  421. array(
  422. 'screen and (min-width: 768px)',
  423. )
  424. );
  425. return $category_rules;
  426. } );