jetpack-fonts.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. <?php
  2. add_filter( 'typekit_add_font_category_rules', function( $category_rules ) {
  3. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  4. '.screen-reader-text:focus',
  5. array(
  6. array( 'property' => 'font-size', 'value' => '15px' ),
  7. array( 'property' => 'font-weight', 'value' => 'bold' ),
  8. )
  9. );
  10. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  11. 'body,
  12. button,
  13. input,
  14. select,
  15. textarea',
  16. array(
  17. array( 'property' => 'font-family', 'value' => '"Source Sans Pro", Helvetica, sans-serif' ),
  18. array( 'property' => 'font-size', 'value' => '18px' ),
  19. array( 'property' => 'font-weight', 'value' => '300' ),
  20. )
  21. );
  22. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  23. 'h1,
  24. h2,
  25. h3,
  26. h4,
  27. h5,
  28. h6',
  29. array(
  30. array( 'property' => 'font-family', 'value' => '"Yrsa", sans-serif' ),
  31. )
  32. );
  33. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  34. 'h1,
  35. .site-title',
  36. array(
  37. array( 'property' => 'font-size', 'value' => '29px' ),
  38. )
  39. );
  40. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  41. 'h2',
  42. array(
  43. array( 'property' => 'font-size', 'value' => '23px' ),
  44. )
  45. );
  46. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  47. 'h3',
  48. array(
  49. array( 'property' => 'font-size', 'value' => '18px' ),
  50. )
  51. );
  52. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  53. 'h4',
  54. array(
  55. array( 'property' => 'font-size', 'value' => '16px' ),
  56. )
  57. );
  58. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  59. 'h5',
  60. array(
  61. array( 'property' => 'font-size', 'value' => '15px' ),
  62. )
  63. );
  64. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  65. 'h6',
  66. array(
  67. array( 'property' => 'font-size', 'value' => '14px' ),
  68. )
  69. );
  70. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  71. 'h1,
  72. .site-title',
  73. array(
  74. array( 'property' => 'font-size', 'value' => '47px' ),
  75. ),
  76. array( 'screen and (min-width: 850px)' )
  77. );
  78. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  79. 'h2',
  80. array(
  81. array( 'property' => 'font-size', 'value' => '29px' ),
  82. ),
  83. array( 'screen and (min-width: 850px)' )
  84. );
  85. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  86. 'h3',
  87. array(
  88. array( 'property' => 'font-size', 'value' => '23px' ),
  89. ),
  90. array( 'screen and (min-width: 850px)' )
  91. );
  92. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  93. 'h4,
  94. .site-description',
  95. array(
  96. array( 'property' => 'font-size', 'value' => '18px' ),
  97. ),
  98. array( 'screen and (min-width: 850px)' )
  99. );
  100. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  101. 'body,
  102. button,
  103. input,
  104. select,
  105. textarea',
  106. array(
  107. array( 'property' => 'font-size', 'value' => '18px' ),
  108. ),
  109. array( 'screen and (min-width: 850px)' )
  110. );
  111. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  112. 'h5',
  113. array(
  114. array( 'property' => 'font-size', 'value' => '16px' ),
  115. ),
  116. array( 'screen and (min-width: 850px)' )
  117. );
  118. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  119. 'h6,
  120. .cat-links a,
  121. .hero-content-wrapper .cat-links a',
  122. array(
  123. array( 'property' => 'font-size', 'value' => '15px' ),
  124. ),
  125. array( 'screen and (min-width: 850px)' )
  126. );
  127. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  128. 'dt',
  129. array(
  130. array( 'property' => 'font-weight', 'value' => 'bold' ),
  131. )
  132. );
  133. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  134. 'b,
  135. strong',
  136. array(
  137. array( 'property' => 'font-weight', 'value' => 'bold' ),
  138. )
  139. );
  140. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  141. 'cite,
  142. dfn,
  143. em,
  144. i',
  145. array(
  146. array( 'property' => 'font-style', 'value' => 'italic' ),
  147. )
  148. );
  149. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  150. 'blockquote',
  151. array(
  152. array( 'property' => 'font-style', 'value' => 'italic' ),
  153. )
  154. );
  155. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  156. 'pre',
  157. array(
  158. array( 'property' => 'font-family', 'value' => '"Courier 10 Pitch", Courier, monospace' ),
  159. array( 'property' => 'font-size', 'value' => '15px' ),
  160. )
  161. );
  162. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  163. 'code,
  164. kbd,
  165. tt,
  166. var',
  167. array(
  168. array( 'property' => 'font-family', 'value' => '"Courier 10 Pitch", Courier, monospace' ),
  169. )
  170. );
  171. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  172. 'sub,
  173. sup',
  174. array(
  175. array( 'property' => 'font-size', 'value' => '75%' ),
  176. )
  177. );
  178. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  179. 'small',
  180. array(
  181. array( 'property' => 'font-size', 'value' => '75%' ),
  182. )
  183. );
  184. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  185. 'big',
  186. array(
  187. array( 'property' => 'font-size', 'value' => '125%' ),
  188. )
  189. );
  190. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  191. 'th',
  192. array(
  193. array( 'property' => 'font-weight', 'value' => 'bold' ),
  194. )
  195. );
  196. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  197. 'legend',
  198. array(
  199. array( 'property' => 'font-weight', 'value' => 'bold' ),
  200. )
  201. );
  202. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  203. 'button,
  204. input,
  205. select,
  206. textarea',
  207. array(
  208. array( 'property' => 'font-size', 'value' => '100%' ),
  209. )
  210. );
  211. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  212. '#infinite-handle span,
  213. button,
  214. input[type="button"],
  215. input[type="reset"],
  216. input[type="submit"],
  217. .woocommerce #respond input#submit,
  218. .woocommerce a.button,
  219. .woocommerce button.button,
  220. .woocommerce input.button,
  221. .woocommerce #respond input#submit.alt,
  222. .woocommerce a.button.alt,
  223. .woocommerce button.button.alt,
  224. .woocommerce input.button.alt',
  225. array(
  226. array( 'property' => 'font-size', 'value' => '15px' ),
  227. array( 'property' => 'font-weight', 'value' => 'bold' ),
  228. )
  229. );
  230. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  231. 'input[type="email"],
  232. input[type="password"],
  233. input[type="search"],
  234. input[type="text"],
  235. input[type="url"]',
  236. array(
  237. array( 'property' => 'font-size', 'value' => '15px' ),
  238. )
  239. );
  240. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  241. 'textarea',
  242. array(
  243. array( 'property' => 'font-size', 'value' => '15px' ),
  244. )
  245. );
  246. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  247. '.main-navigation a',
  248. array(
  249. array( 'property' => 'font-size', 'value' => '15px' ),
  250. array( 'property' => 'font-weight', 'value' => 'bold' ),
  251. )
  252. );
  253. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  254. '.menu-toggle',
  255. array(
  256. array( 'property' => 'font-family', 'value' => '"Source Sans Pro", Helvetica, sans-serif' ),
  257. array( 'property' => 'font-size', 'value' => '15px' ),
  258. array( 'property' => 'font-weight', 'value' => 'bold' ),
  259. )
  260. );
  261. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  262. '.menu-toggle:before',
  263. array(
  264. array( 'property' => 'font-family', 'value' => 'Genericons' ),
  265. )
  266. );
  267. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  268. '.jetpack-social-navigation ul li',
  269. array(
  270. array( 'property' => 'font-size', 'value' => '20px' ),
  271. )
  272. );
  273. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  274. '.comment-navigation a,
  275. .paging-navigation a,
  276. .post-navigation a',
  277. array(
  278. array( 'property' => 'font-family', 'value' => '"Yrsa", Georgia, serif' ),
  279. array( 'property' => 'font-size', 'value' => '18px' ),
  280. )
  281. );
  282. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  283. '.post-navigation .title',
  284. array(
  285. array( 'property' => 'font-family', 'value' => '"Source Sans Pro", Helvetica, sans-serif' ),
  286. array( 'property' => 'font-style', 'value' => 'normal' ),
  287. array( 'property' => 'font-weight', 'value' => 'bold' ),
  288. array( 'property' => 'font-size', 'value' => '15px' ),
  289. )
  290. );
  291. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  292. '.screen-reader-text:focus',
  293. array(
  294. array( 'property' => 'font-size', 'value' => '15px' ),
  295. array( 'property' => 'font-weight', 'value' => 'bold' ),
  296. )
  297. );
  298. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  299. '.widget',
  300. array(
  301. array( 'property' => 'font-size', 'value' => '16px' ),
  302. )
  303. );
  304. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  305. '.widget-title',
  306. array(
  307. array( 'property' => 'font-size', 'value' => '18px' ),
  308. )
  309. );
  310. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  311. '.widget_calendar td a',
  312. array(
  313. array( 'property' => 'font-weight', 'value' => 'bold' ),
  314. )
  315. );
  316. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  317. '.site-title',
  318. array(
  319. array( 'property' => 'font-family', 'value' => '"Yrsa", Georgia, Serif' ),
  320. array( 'property' => 'font-size', 'value' => '29px' ),
  321. )
  322. );
  323. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  324. '.site-description',
  325. array(
  326. array( 'property' => 'font-family', 'value' => '"Yrsa", Georgia, serif' ),
  327. array( 'property' => 'font-size', 'value' => '16px' ),
  328. array( 'property' => 'font-weight', 'value' => 'normal' ),
  329. )
  330. );
  331. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  332. '.taxonomy-description',
  333. array(
  334. array( 'property' => 'font-size', 'value' => '16px' ),
  335. )
  336. );
  337. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  338. '.archive .page-title,
  339. .search .page-title',
  340. array(
  341. array( 'property' => 'font-family', 'value' => '"Source Sans Pro", Helvetica, sans-serif' ),
  342. array( 'property' => 'font-size', 'value' => '15px' ),
  343. array( 'property' => 'font-weight', 'value' => 'bold' ),
  344. )
  345. );
  346. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  347. '.entry-title,
  348. .entry-title a,
  349. .page-title,
  350. .woocommerce .page-title',
  351. array(
  352. array( 'property' => 'font-size', 'value' => '29px' ),
  353. )
  354. );
  355. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  356. '.entry-title,
  357. .entry-title a,
  358. .page-title,
  359. .woocommerce .page-title',
  360. array(
  361. array( 'property' => 'font-size', 'value' => '32px' ),
  362. ),
  363. array( 'screen and (min-width: 850px)' )
  364. );
  365. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  366. '.entry-footer,
  367. .entry-meta',
  368. array(
  369. array( 'property' => 'font-family', 'value' => '"Yrsa", Georgia, serif' ),
  370. array( 'property' => 'font-size', 'value' => '16px' ),
  371. )
  372. );
  373. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  374. '.cat-links a',
  375. array(
  376. array( 'property' => 'font-family', 'value' => '"Source Sans Pro"' ),
  377. array( 'property' => 'font-style', 'value' => 'normal' ),
  378. array( 'property' => 'font-size', 'value' => '13px' ),
  379. array( 'property' => 'font-weight', 'value' => 'bold' ),
  380. ),
  381. array( 'screen and (min-width: 850px)' )
  382. );
  383. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  384. '.cat-links a',
  385. array(
  386. array( 'property' => 'font-size', 'value' => '15px' ),
  387. )
  388. );
  389. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  390. 'blockquote:before',
  391. array(
  392. array( 'property' => 'font-family', 'value' => '"Yrsa", Georgia, serif' ),
  393. array( 'property' => 'font-size', 'value' => '140px' ),
  394. array( 'property' => 'font-style', 'value' => 'normal' ),
  395. )
  396. );
  397. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  398. 'blockquote',
  399. array(
  400. array( 'property' => 'font-family', 'value' => '"Yrsa", Georgia, serif' ),
  401. array( 'property' => 'font-size', 'value' => '23px' ),
  402. array( 'property' => 'font-style', 'value' => 'normal' ),
  403. )
  404. );
  405. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  406. 'blockquote cite',
  407. array(
  408. array( 'property' => 'font-family', 'value' => '"Source Sans Pro", Helvetica, sans-serif' ),
  409. array( 'property' => 'font-size', 'value' => '16px' ),
  410. array( 'property' => 'font-weight', 'value' => 'bold' ),
  411. )
  412. );
  413. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  414. '.comments-title',
  415. array(
  416. array( 'property' => 'font-size', 'value' => '29px' ),
  417. )
  418. );
  419. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  420. '.author-bio',
  421. array(
  422. array( 'property' => 'font-size', 'value' => '16px' ),
  423. )
  424. );
  425. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  426. '.author-title',
  427. array(
  428. array( 'property' => 'font-size', 'value' => '23px' ),
  429. )
  430. );
  431. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  432. '.comment-meta .fn',
  433. array(
  434. array( 'property' => 'font-size', 'value' => '15px' ),
  435. array( 'property' => 'font-weight', 'value' => 'bold' ),
  436. array( 'property' => 'font-style', 'value' => 'normal' ),
  437. )
  438. );
  439. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  440. '.comment-metadata',
  441. array(
  442. array( 'property' => 'font-size', 'value' => '16px' ),
  443. )
  444. );
  445. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  446. '.comment-form-author label,
  447. .comment-form-comment label,
  448. .comment-form-email label,
  449. .comment-form-url label',
  450. array(
  451. array( 'property' => 'font-size', 'value' => '15px' ),
  452. array( 'property' => 'font-weight', 'value' => 'bold' ),
  453. )
  454. );
  455. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  456. '.form-allowed-tags',
  457. array(
  458. array( 'property' => 'font-size', 'value' => '15px' ),
  459. )
  460. );
  461. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  462. '.flex-direction-nav a:before',
  463. array(
  464. array( 'property' => 'font-family', 'value' => '"Genericons"' ),
  465. array( 'property' => 'font-size', 'value' => '32px' ),
  466. )
  467. );
  468. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  469. '.hero-content-wrapper .entry-title',
  470. array(
  471. array( 'property' => 'font-weight', 'value' => 'bold' ),
  472. )
  473. );
  474. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  475. '.featured-page',
  476. array(
  477. array( 'property' => 'font-size', 'value' => '16px' ),
  478. )
  479. );
  480. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  481. '.featured-page .entry-title,
  482. .featured-page .entry-title a',
  483. array(
  484. array( 'property' => 'font-size', 'value' => '23px' ),
  485. array( 'property' => 'font-weight', 'value' => 'normal' ),
  486. )
  487. );
  488. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  489. '.featured-page .entry-title,
  490. .featured-page .entry-title a',
  491. array(
  492. array( 'property' => 'font-size', 'value' => '23px' ),
  493. array( 'property' => 'font-weight', 'value' => 'normal' ),
  494. ),
  495. array( 'screen and (min-width: 850px)' )
  496. );
  497. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  498. '.comment-body .edit-link a,
  499. .front-testimonials .edit-link a,
  500. body:not(.search):not(.single-jetpack-testimonial) .jetpack-testimonial .edit-link a',
  501. array(
  502. array( 'property' => 'font-family', 'value' => '"Yrsa", Georgia, serif' ),
  503. array( 'property' => 'font-size', 'value' => '15px' ),
  504. )
  505. );
  506. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  507. '.jetpack-testimonial-shortcode .testimonial-entry-title,
  508. body:not(.search):not(.single-jetpack-testimonial) .jetpack-testimonial .entry-title,
  509. body:not(.search):not(.single-jetpack-testimonial) .jetpack-testimonial .entry-title a',
  510. array(
  511. array( 'property' => 'font-family', 'value' => '"Source Sans Pro", Helvetica, sans-serif' ),
  512. array( 'property' => 'font-size', 'value' => '15px' ),
  513. array( 'property' => 'font-weight', 'value' => 'bold' ),
  514. )
  515. );
  516. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  517. '.jetpack-testimonial-shortcode .testimonial-entry-content,
  518. body:not(.search):not(.single-jetpack-testimonial) .jetpack-testimonial .entry-content',
  519. array(
  520. array( 'property' => 'font-style', 'value' => 'italic' ),
  521. )
  522. );
  523. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  524. '.site-footer',
  525. array(
  526. array( 'property' => 'font-size', 'value' => '15px' ),
  527. )
  528. );
  529. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  530. '.wp-caption-dd,
  531. .wp-caption-text',
  532. array(
  533. array( 'property' => 'font-size', 'value' => '15px' ),
  534. array( 'property' => 'font-style', 'value' => 'italic' ),
  535. )
  536. );
  537. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  538. '.gallery-caption',
  539. array(
  540. array( 'property' => 'font-size', 'value' => '15px' ),
  541. )
  542. );
  543. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  544. '.main-navigation .menu-item-has-children > a:after,
  545. .main-navigation .page_item_has_children > a:after',
  546. array(
  547. array( 'property' => 'font-family', 'value' => 'Genericons' ),
  548. array( 'property' => 'font-size', 'value' => '8px' ),
  549. )
  550. );
  551. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  552. '.main-navigation ul ul a',
  553. array(
  554. array( 'property' => 'font-size', 'value' => '15px' ),
  555. array( 'property' => 'font-weight', 'value' => 'normal' ),
  556. )
  557. );
  558. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  559. '.hero-content-wrapper .entry-title',
  560. array(
  561. array( 'property' => 'font-size', 'value' => '29px' ),
  562. )
  563. );
  564. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  565. '.hero-content-wrapper .entry-title',
  566. array(
  567. array( 'property' => 'font-size', 'value' => '47px' ),
  568. ),
  569. array( 'screen and (min-width: 1180px)' )
  570. );
  571. TypekitTheme::add_font_category_rule( $category_rules, 'none',
  572. '.flex-direction-nav a:before',
  573. array(
  574. array( 'property' => 'font-size', 'value' => '64px' ),
  575. )
  576. );
  577. return $category_rules;
  578. } );