jetpack-fonts.php 14 KB

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