jetpack-fonts.php 17 KB

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