jetpack-fonts.php 14 KB

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