jetpack-fonts.php 18 KB

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