jetpack-fonts.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <?php
  2. add_filter( 'typekit_add_font_category_rules', function( $category_rules ) {
  3. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  4. 'html',
  5. array(
  6. array( 'property' => 'font-family', 'value' => 'sans-serif' ),
  7. )
  8. );
  9. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  10. 'b,
  11. strong',
  12. array(
  13. array( 'property' => 'font-weight', 'value' => 'bold' ),
  14. )
  15. );
  16. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  17. 'dfn',
  18. array(
  19. array( 'property' => 'font-style', 'value' => 'italic' ),
  20. )
  21. );
  22. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  23. 'h1',
  24. array(
  25. array( 'property' => 'font-size', 'value' => '2em' ),
  26. )
  27. );
  28. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  29. 'small',
  30. array(
  31. array( 'property' => 'font-size', 'value' => '80%' ),
  32. )
  33. );
  34. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  35. 'sub,
  36. sup',
  37. array(
  38. array( 'property' => 'font-size', 'value' => '75%' ),
  39. )
  40. );
  41. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  42. '.archive .read-more a,
  43. .blog .read-more a,
  44. .search-results .read-more a,
  45. button,
  46. input,
  47. optgroup,
  48. select,
  49. textarea',
  50. array(
  51. array( 'property' => 'font', 'value' => 'inherit' ),
  52. )
  53. );
  54. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  55. 'optgroup',
  56. array(
  57. array( 'property' => 'font-weight', 'value' => 'bold' ),
  58. )
  59. );
  60. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  61. '.archive .read-more a,
  62. .blog .read-more a,
  63. .search-results .read-more a,
  64. body,
  65. button,
  66. input,
  67. select,
  68. textarea',
  69. array(
  70. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  71. array( 'property' => 'font-size', 'value' => '18px' ),
  72. )
  73. );
  74. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  75. '.site-branding .site-title,
  76. .widget-title,
  77. h1,
  78. h2,
  79. h3,
  80. h4,
  81. h5,
  82. h6',
  83. array(
  84. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  85. array( 'property' => 'font-weight', 'value' => '400' ),
  86. )
  87. );
  88. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  89. '.pique-template-testimonials .pique-testimonials article .entry-content cite,
  90. blockquote cite',
  91. array(
  92. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  93. array( 'property' => 'font-weight', 'value' => '400' ),
  94. array( 'property' => 'font-size', 'value' => '12px' ),
  95. )
  96. );
  97. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  98. 'h1',
  99. array(
  100. array( 'property' => 'font-size', 'value' => '38px' ),
  101. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  102. array( 'property' => 'font-style', 'value' => 'italic' ),
  103. )
  104. );
  105. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  106. 'h2',
  107. array(
  108. array( 'property' => 'font-size', 'value' => '26px' ),
  109. array( 'property' => 'font-weight', 'value' => '600' ),
  110. )
  111. );
  112. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  113. '.site-branding .site-title,
  114. .widget-title,
  115. h3',
  116. array(
  117. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  118. array( 'property' => 'font-weight', 'value' => '700' ),
  119. array( 'property' => 'font-size', 'value' => '1.2em' ),
  120. )
  121. );
  122. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  123. 'h4',
  124. array(
  125. array( 'property' => 'font-size', 'value' => '1.999em' ),
  126. )
  127. );
  128. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  129. 'h5',
  130. array(
  131. array( 'property' => 'font-size', 'value' => '1.414em' ),
  132. )
  133. );
  134. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  135. 'h6',
  136. array(
  137. array( 'property' => 'font-size', 'value' => '1em' ),
  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. '.pique-template-testimonials .pique-testimonials article .entry-content,
  151. blockquote',
  152. array(
  153. array( 'property' => 'font-size', 'value' => '24px' ),
  154. array( 'property' => 'font-style', 'value' => 'italic' ),
  155. )
  156. );
  157. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  158. '.pique-template-testimonials .pique-testimonials article .entry-content cite,
  159. blockquote cite',
  160. array(
  161. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  162. array( 'property' => 'font-weight', 'value' => '700' ),
  163. array( 'property' => 'font-size', 'value' => '12px' ),
  164. )
  165. );
  166. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  167. 'big',
  168. array(
  169. array( 'property' => 'font-size', 'value' => '125%' ),
  170. )
  171. );
  172. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  173. 'dt',
  174. array(
  175. array( 'property' => 'font-weight', 'value' => 'bold' ),
  176. )
  177. );
  178. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  179. 'label',
  180. array(
  181. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  182. array( 'property' => 'font-size', 'value' => '0.8em' ),
  183. array( 'property' => 'font-weight', 'value' => '500' ),
  184. )
  185. );
  186. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  187. 'input[type="email"],
  188. input[type="password"],
  189. input[type="search"],
  190. input[type="text"],
  191. input[type="url"],
  192. textarea',
  193. array(
  194. array( 'property' => 'font-size', 'value' => '16px' ),
  195. )
  196. );
  197. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  198. 'input[type="email"],
  199. input[type="password"],
  200. input[type="search"],
  201. input[type="text"],
  202. input[type="url"]',
  203. array(
  204. array( 'property' => 'font-style', 'value' => 'italic' ),
  205. )
  206. );
  207. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  208. '.archive .read-more a,
  209. .blog .read-more a,
  210. .button,
  211. .search-results .read-more a,
  212. button,
  213. input[type="button"],
  214. input[type="reset"],
  215. input[type="submit"]',
  216. array(
  217. array( 'property' => 'font-size', 'value' => '15px' ),
  218. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  219. array( 'property' => 'font-weight', 'value' => 'bold' ),
  220. )
  221. );
  222. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  223. '.pique-template-recent-posts .read-more a,
  224. .pique-panel .edit-link a',
  225. array(
  226. array( 'property' => 'font-size', 'value' => '13px' ),
  227. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  228. array( 'property' => 'font-weight', 'value' => 'normal' ),
  229. )
  230. );
  231. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  232. '.site-branding .site-title',
  233. array(
  234. array( 'property' => 'font-style', 'value' => 'normal' ),
  235. ),
  236. array(
  237. '(max-width: 767px)',
  238. )
  239. );
  240. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  241. '.site-branding .site-description',
  242. array(
  243. array( 'property' => 'font-style', 'value' => 'italic' ),
  244. )
  245. );
  246. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  247. '.main-navigation,
  248. .woocommerce-breadcrumb,
  249. .woocommerce-result-count,
  250. .woocommerce-ordering .orderby,
  251. .product .onsale,
  252. ul.products li.product .added_to_cart,
  253. .woocommerce-pagination,
  254. .single-product div.product .related h2,
  255. .woocommerce-checkout-payment ul .payment_box p,
  256. .woocommerce-order-details h2,
  257. .woocommerce-customer-details h2,
  258. .woocommerce-tabs .panel h2:first-of-type,
  259. .woocommerce-tabs ul.tabs li a,
  260. .woocommerce-MyAccount-navigation a,
  261. .woocommerce.widget_layered_nav_filters .amount,
  262. .woocommerce-breadcrumb,
  263. .woocommerce-result-count,
  264. .woocommerce-ordering .orderby',
  265. array(
  266. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  267. )
  268. );
  269. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  270. '.main-navigation a',
  271. array(
  272. array( 'property' => 'font-size', 'value' => '13px' ),
  273. )
  274. );
  275. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  276. '.comment-navigation .nav-next a,
  277. .comment-navigation .nav-previous a,
  278. .post-navigation .nav-next a,
  279. .post-navigation .nav-previous a,
  280. .posts-navigation .nav-next a,
  281. .posts-navigation .nav-previous a',
  282. array(
  283. array( 'property' => 'font-size', 'value' => '18px' ),
  284. array( 'property' => 'font-style', 'value' => 'italic' ),
  285. )
  286. );
  287. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  288. '.comment-navigation .nav-next a span,
  289. .comment-navigation .nav-previous a span,
  290. .post-navigation .nav-next a span,
  291. .post-navigation .nav-previous a span,
  292. .posts-navigation .nav-next a span,
  293. .posts-navigation .nav-previous a span',
  294. array(
  295. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  296. array( 'property' => 'font-style', 'value' => 'normal' ),
  297. array( 'property' => 'font-weight', 'value' => 'bold' ),
  298. array( 'property' => 'font-size', 'value' => '14px' ),
  299. )
  300. );
  301. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  302. '.widget',
  303. array(
  304. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  305. )
  306. );
  307. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  308. '.widget select',
  309. array(
  310. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  311. array( 'property' => 'font-size', 'value' => '15px' ),
  312. ),
  313. array(
  314. '(max-width: 767px)',
  315. )
  316. );
  317. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  318. '.pique-template-testimonials .pique-testimonials article .entry-content .widget cite:not(.widget-title),
  319. .site-branding .widget .site-title:not(.widget-title),
  320. .widget .pique-template-testimonials .pique-testimonials article .entry-content cite:not(.widget-title),
  321. .widget .site-branding .site-title:not(.widget-title),
  322. .widget .widget-title:not(.widget-title),
  323. .widget blockquote cite:not(.widget-title),
  324. .widget h2:not(.widget-title),
  325. .widget h3:not(.widget-title),
  326. .widget h4:not(.widget-title),
  327. blockquote .widget cite:not(.widget-title)',
  328. array(
  329. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  330. array( 'property' => 'font-size', 'value' => '29px' ),
  331. array( 'property' => 'font-style', 'value' => 'italic' ),
  332. array( 'property' => 'font-weight', 'value' => 'normal' ),
  333. ),
  334. array(
  335. '(max-width: 767px)',
  336. )
  337. );
  338. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  339. '.widget_recent_comments li',
  340. array(
  341. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  342. array( 'property' => 'font-style', 'value' => 'italic' ),
  343. ),
  344. array(
  345. '(max-width: 767px)',
  346. )
  347. );
  348. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  349. '.overlay',
  350. array(
  351. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  352. array( 'property' => 'font-size', 'value' => '14px' ),
  353. )
  354. );
  355. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  356. '.widget_recent_comments li a',
  357. array(
  358. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  359. array( 'property' => 'font-style', 'value' => 'normal' ),
  360. ),
  361. array(
  362. '(max-width: 767px)',
  363. )
  364. );
  365. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  366. '.widget_rss .rssSummary',
  367. array(
  368. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  369. array( 'property' => 'font-style', 'value' => 'italic' ),
  370. ),
  371. array(
  372. '(max-width: 767px)',
  373. )
  374. );
  375. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  376. '.widget_rss cite',
  377. array(
  378. array( 'property' => 'font-style', 'value' => 'normal' ),
  379. ),
  380. array(
  381. '(max-width: 767px)',
  382. )
  383. );
  384. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  385. '.textwidget',
  386. array(
  387. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  388. array( 'property' => 'font-style', 'value' => 'italic' ),
  389. array( 'property' => 'font-size', 'value' => '1.2em' ),
  390. ),
  391. array(
  392. '(max-width: 767px)',
  393. )
  394. );
  395. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  396. '.widget_tag_cloud .tagcloud',
  397. array(
  398. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  399. array( 'property' => 'font-style', 'value' => 'italic' ),
  400. ),
  401. array(
  402. '(max-width: 767px)',
  403. )
  404. );
  405. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  406. '.widget_calendar caption',
  407. array(
  408. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  409. array( 'property' => 'font-style', 'value' => 'italic' ),
  410. ),
  411. array(
  412. '(max-width: 767px)',
  413. )
  414. );
  415. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  416. '.pique-sidebar .widget-area',
  417. array(
  418. array( 'property' => 'font-size', 'value' => '15px' ),
  419. ),
  420. array(
  421. '(max-width: 767px)',
  422. )
  423. );
  424. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  425. '.comment-metadata,
  426. .entry-meta,
  427. .reply,
  428. .widget_rss .rss-date,
  429. .widget_rss cite',
  430. array(
  431. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  432. array( 'property' => 'font-weight', 'value' => 'bold' ),
  433. array( 'property' => 'font-size', 'value' => '14px' ),
  434. )
  435. );
  436. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  437. '.page-links',
  438. array(
  439. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  440. array( 'property' => 'font-size', 'value' => '14px' ),
  441. )
  442. );
  443. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  444. '.cat-links,
  445. .tags-links',
  446. array(
  447. array( 'property' => 'font-family', 'value' => 'Lora, Georgia, serif' ),
  448. array( 'property' => 'font-size', 'value' => '14px' ),
  449. array( 'property' => 'font-style', 'value' => 'italic' ),
  450. )
  451. );
  452. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  453. '#commentform .comment-notes,
  454. #commentform .logged-in-as',
  455. array(
  456. array( 'property' => 'font-size', 'value' => '16px' ),
  457. array( 'property' => 'font-style', 'value' => 'italic' ),
  458. )
  459. );
  460. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  461. '#form-allowed-tags',
  462. array(
  463. array( 'property' => 'font-size', 'value' => '14px' ),
  464. array( 'property' => 'font-style', 'value' => 'italic' ),
  465. )
  466. );
  467. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  468. '.comment-author .fn',
  469. array(
  470. array( 'property' => 'font-size', 'value' => '19px' ),
  471. array( 'property' => 'font-style', 'value' => 'italic' ),
  472. array( 'property' => 'font-weight', 'value' => 'normal' ),
  473. )
  474. );
  475. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  476. '.comment-content',
  477. array(
  478. array( 'property' => 'font-size', 'value' => '0.9em' ),
  479. )
  480. );
  481. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  482. '.pingback,
  483. .trackback',
  484. array(
  485. array( 'property' => 'font-style', 'value' => 'italic' ),
  486. )
  487. );
  488. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  489. '#infinite-footer',
  490. array(
  491. array( 'property' => 'font-family', 'value' => 'Karla, Arial, sans-serif' ),
  492. )
  493. );
  494. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  495. '#infinite-footer #infinity-blog-title',
  496. array(
  497. array( 'property' => 'font-weight', 'value' => 'normal' ),
  498. )
  499. );
  500. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  501. '.archive .read-more .infinite-scroll #infinite-handle a,
  502. .blog .read-more .infinite-scroll #infinite-handle a,
  503. .infinite-scroll #infinite-handle .archive .read-more a,
  504. .infinite-scroll #infinite-handle .blog .read-more a,
  505. .infinite-scroll #infinite-handle .search-results .read-more a,
  506. .infinite-scroll #infinite-handle button,
  507. .search-results .read-more .infinite-scroll #infinite-handle a',
  508. array(
  509. array( 'property' => 'font-size', 'value' => '19px' ),
  510. array( 'property' => 'font-style', 'value' => 'italic' ),
  511. )
  512. );
  513. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  514. '.archive .read-more .infinite-scroll #infinite-handle a:hover,
  515. .blog .read-more .infinite-scroll #infinite-handle a:hover,
  516. .infinite-scroll #infinite-handle .archive .read-more a:hover,
  517. .infinite-scroll #infinite-handle .blog .read-more a:hover,
  518. .infinite-scroll #infinite-handle .search-results .read-more a:hover,
  519. .infinite-scroll #infinite-handle button:hover,
  520. .search-results .read-more .infinite-scroll #infinite-handle a:hover',
  521. array(
  522. array( 'property' => 'font-size', 'value' => '19px' ),
  523. )
  524. );
  525. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  526. '.tiled-gallery-caption,
  527. .wp-caption-text',
  528. array(
  529. array( 'property' => 'font-style', 'value' => 'italic' ),
  530. )
  531. );
  532. return $category_rules;
  533. } );