jetpack-fonts.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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. button,
  6. input,
  7. select,
  8. textarea',
  9. array(
  10. array( 'property' => 'font-family', 'value' => '"Karla", "Helvetica Neue", helvetica, arial, sans-serif' ),
  11. array( 'property' => 'font-size', 'value' => '16px' ),
  12. )
  13. );
  14. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  15. 'h1,
  16. h2,
  17. h3,
  18. h4,
  19. h5,
  20. h6',
  21. array(
  22. array( 'property' => 'font-family', 'value' => '"Work Sans", "Helvetica Neue", helvetica, arial, sans-serif' ),
  23. array( 'property' => 'font-weight', 'value' => '800' ),
  24. )
  25. );
  26. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  27. 'h1',
  28. array(
  29. array( 'property' => 'font-size', 'value' => '30px' ),
  30. )
  31. );
  32. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  33. 'h2',
  34. array(
  35. array( 'property' => 'font-size', 'value' => '26px' ),
  36. )
  37. );
  38. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  39. 'h3',
  40. array(
  41. array( 'property' => 'font-size', 'value' => '22px' ),
  42. )
  43. );
  44. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  45. 'h4',
  46. array(
  47. array( 'property' => 'font-size', 'value' => '18px' ),
  48. )
  49. );
  50. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  51. 'h5',
  52. array(
  53. array( 'property' => 'font-size', 'value' => '16px' ),
  54. )
  55. );
  56. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  57. 'h6',
  58. array(
  59. array( 'property' => 'font-size', 'value' => '14px' ),
  60. )
  61. );
  62. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  63. 'cite,
  64. dfn,
  65. em,
  66. i',
  67. array(
  68. array( 'property' => 'font-style', 'value' => 'italic' ),
  69. )
  70. );
  71. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  72. 'pre',
  73. array(
  74. array( 'property' => 'font-family', 'value' => '"Courier 10 Pitch", Courier, monospace' ),
  75. array( 'property' => 'font-size', 'value' => '15px' ),
  76. )
  77. );
  78. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  79. 'code,
  80. kbd,
  81. tt,
  82. var',
  83. array(
  84. array( 'property' => 'font-family', 'value' => 'Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace' ),
  85. array( 'property' => 'font-size', 'value' => '15px' ),
  86. )
  87. );
  88. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  89. '#infinite-handle span button,
  90. #infinite-handle span button:focus,
  91. #infinite-handle span button:hover,
  92. button,
  93. input[type="button"],
  94. input[type="reset"],
  95. input[type="submit"]',
  96. array(
  97. array( 'property' => 'font-size', 'value' => '14px' ),
  98. )
  99. );
  100. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  101. 'dt',
  102. array(
  103. array( 'property' => 'font-weight', 'value' => 'bold' ),
  104. )
  105. );
  106. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  107. '.site-title',
  108. array(
  109. array( 'property' => 'font-family', 'value' => '"Work Sans", "Helvetica Neue", helvetica, arial, sans-serif' ),
  110. array( 'property' => 'font-size', 'value' => '30px' ),
  111. array( 'property' => 'font-weight', 'value' => '800' ),
  112. )
  113. );
  114. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  115. '.site-description',
  116. array(
  117. array( 'property' => 'font-size', 'value' => '18px' ),
  118. array( 'property' => 'font-family', 'value' => '"Karla", "Helvetica Neue", helvetica, arial, sans-serif' ),
  119. )
  120. );
  121. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  122. '.menu-toggle',
  123. array(
  124. array( 'property' => 'font-size', 'value' => '16px' ),
  125. )
  126. );
  127. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  128. '.lodestar-intro .entry-content',
  129. array(
  130. array( 'property' => 'font-size', 'value' => '20px' ),
  131. )
  132. );
  133. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  134. '.nav-subtitle',
  135. array(
  136. array( 'property' => 'font-weight', 'value' => 'bold' ),
  137. array( 'property' => 'font-weight', 'value' => '800' ),
  138. )
  139. );
  140. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  141. '.entry-author h2,
  142. .entry-author h3',
  143. array(
  144. array( 'property' => 'font-size', 'value' => '16px' ),
  145. )
  146. );
  147. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  148. '.project-terms-intro',
  149. array(
  150. array( 'property' => 'font-weight', 'value' => 'bold' ),
  151. )
  152. );
  153. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  154. '.comments-title',
  155. array(
  156. array( 'property' => 'font-size', 'value' => '24px' ),
  157. )
  158. );
  159. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  160. '.comment-awaiting-moderation,
  161. .no-comments',
  162. array(
  163. array( 'property' => 'font-style', 'value' => 'italic' ),
  164. )
  165. );
  166. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  167. 'h2.widget-title',
  168. array(
  169. array( 'property' => 'font-size', 'value' => '18px' ),
  170. )
  171. );
  172. TypekitTheme::add_font_category_rule( $category_rules, 'placeholder',
  173. '.widget_goodreads div[class^="gr_custom_author"]',
  174. array(
  175. array( 'property' => 'font-size', 'value' => '12px' ),
  176. )
  177. );
  178. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  179. '.widget-grofile h4',
  180. array(
  181. array( 'property' => 'font-size', 'value' => '16px' ),
  182. )
  183. );
  184. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  185. '.entry-content div#jp-relatedposts h3.jp-relatedposts-headline,
  186. .entry-content div.sharedaddy h3,
  187. .entry-content div.sharedaddy h3.sd-title',
  188. array(
  189. array( 'property' => 'font-family', 'value' => '"Karla", "Helvetica Neue", helvetica, arial, sans-serif' ),
  190. array( 'property' => 'font-weight', 'value' => 'normal' ),
  191. array( 'property' => 'font-size', 'value' => '14px' ),
  192. )
  193. );
  194. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  195. '.entry-content div#jp-relatedposts h3.jp-relatedposts-headline em',
  196. array(
  197. array( 'property' => 'font-weight', 'value' => 'normal' ),
  198. )
  199. );
  200. /* WooCommerce */
  201. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  202. 'ul.products li.product .woocommerce-loop-category__title,
  203. ul.products li.product .woocommerce-loop-product__title',
  204. array(
  205. array( 'property' => 'font-family', 'value' => '"Karla", "Helvetica Neue", helvetica, arial, sans-serif' ),
  206. array( 'property' => 'font-size', 'value' => '16px' ),
  207. )
  208. );
  209. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  210. '.site-header-cart,
  211. .woocommerce-checkout-payment .payment_box,
  212. .woocommerce-breadcrumb,
  213. .single-product div.product .product_meta span:not(.sku)',
  214. array(
  215. array( 'property' => 'font-size', 'value' => '16px' ),
  216. )
  217. );
  218. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  219. '.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
  220. .woocommerce-Button,
  221. .woocommerce-Button:visited,
  222. .woocommerce-Button:hover,
  223. .woocommerce-page .button,
  224. .woocommerce-page .button:visited,
  225. .site-header-cart .button,
  226. .site-header-cart .button:visited',
  227. array(
  228. array( 'property' => 'font-size', 'value' => '14px' ),
  229. )
  230. );
  231. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  232. '.site-header-cart .widget_shopping_cart .woocommerce-mini-cart__buttons .button',
  233. array(
  234. array( 'property' => 'font-size', 'value' => '14px' ),
  235. ),
  236. array(
  237. '(min-width: 60em)'
  238. )
  239. );
  240. /* Media Queries */
  241. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  242. 'h1',
  243. array(
  244. array( 'property' => 'font-size', 'value' => '34px' ),
  245. ),
  246. array(
  247. '(min-width: 60em)'
  248. )
  249. );
  250. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  251. 'h2',
  252. array(
  253. array( 'property' => 'font-size', 'value' => '28px' ),
  254. ),
  255. array(
  256. '(min-width: 60em)'
  257. )
  258. );
  259. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  260. 'h3',
  261. array(
  262. array( 'property' => 'font-size', 'value' => '24px' ),
  263. ),
  264. array(
  265. '(min-width: 60em)'
  266. )
  267. );
  268. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  269. 'h4',
  270. array(
  271. array( 'property' => 'font-size', 'value' => '20px' ),
  272. ),
  273. array(
  274. '(min-width: 60em)'
  275. )
  276. );
  277. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  278. 'h5',
  279. array(
  280. array( 'property' => 'font-size', 'value' => '16px' ),
  281. ),
  282. array(
  283. '(min-width: 60em)'
  284. )
  285. );
  286. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  287. 'h6',
  288. array(
  289. array( 'property' => 'font-size', 'value' => '14px' ),
  290. ),
  291. array(
  292. '(min-width: 60em)'
  293. )
  294. );
  295. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  296. '.site-title',
  297. array(
  298. array( 'property' => 'font-size', 'value' => '60px' ),
  299. ),
  300. array(
  301. '(min-width: 60em)'
  302. )
  303. );
  304. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  305. '.site-description',
  306. array(
  307. array( 'property' => 'font-size', 'value' => '24px' ),
  308. ),
  309. array(
  310. '(min-width: 60em)'
  311. )
  312. );
  313. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  314. '.lodestar-intro .entry-content',
  315. array(
  316. array( 'property' => 'font-size', 'value' => '30px' ),
  317. ),
  318. array(
  319. '(min-width: 60em)'
  320. )
  321. );
  322. return $category_rules;
  323. } );