jetpack-fonts.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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' => '"Source Sans Pro", sans-serif' ),
  11. array( 'property' => 'font-size', 'value' => '1.0em' ),
  12. )
  13. );
  14. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  15. 'h1,
  16. h2:not(.site-description),
  17. h3,
  18. h4,
  19. h5,
  20. h6',
  21. array(
  22. array( 'property' => 'font-family', 'value' => '"Source Sans Pro", sans-serif' ),
  23. array( 'property' => 'font-weight', 'value' => 'bold' ),
  24. )
  25. );
  26. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  27. 'h1',
  28. array(
  29. array( 'property' => 'font-size', 'value' => '1.8em' ),
  30. )
  31. );
  32. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  33. 'h2:not(.site-description)',
  34. array(
  35. array( 'property' => 'font-size', 'value' => '1.6em' ),
  36. )
  37. );
  38. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  39. 'h3',
  40. array(
  41. array( 'property' => 'font-size', 'value' => '1.4em' ),
  42. )
  43. );
  44. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  45. 'h4',
  46. array(
  47. array( 'property' => 'font-size', 'value' => '1.2em' ),
  48. )
  49. );
  50. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  51. 'h5',
  52. array(
  53. array( 'property' => 'font-size', 'value' => '1.0em' ),
  54. )
  55. );
  56. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  57. 'h6',
  58. array(
  59. array( 'property' => 'font-size', 'value' => '0.8em' ),
  60. )
  61. );
  62. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  63. 'blockquote',
  64. array(
  65. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  66. array( 'property' => 'font-size', 'value' => '1.2em' ),
  67. )
  68. );
  69. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  70. '.site-title',
  71. array(
  72. array( 'property' => 'font-family', 'value' => '"Source Sans Pro", sans-serif' ),
  73. array( 'property' => 'font-size', 'value' => '3.6em' ),
  74. array( 'property' => 'font-weight', 'value' => '900' ),
  75. )
  76. );
  77. TypekitTheme::add_font_category_rule( $category_rules, 'headings',
  78. '.site-title',
  79. array(
  80. array( 'property' => 'font-size', 'value' => '2em' ),
  81. ),
  82. array( 'screen and (max-width: 767px)')
  83. );
  84. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  85. '.site-description',
  86. array(
  87. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  88. array( 'property' => 'font-size', 'value' => '0.73em' ),
  89. array( 'property' => 'font-weight', 'value' => 'normal' ),
  90. array( 'property' => 'font-style', 'value' => 'italic' ),
  91. )
  92. );
  93. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  94. '.widget_rss .rss-date',
  95. array(
  96. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  97. array( 'property' => 'font-size', 'value' => '0.73em' ),
  98. array( 'property' => 'font-style', 'value' => 'italic' ),
  99. )
  100. );
  101. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  102. '.taxonomy-description',
  103. array(
  104. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  105. array( 'property' => 'font-size', 'value' => '0.73em' ),
  106. array( 'property' => 'font-style', 'value' => 'italic' ),
  107. )
  108. );
  109. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  110. '.cat-links,
  111. .featured-post',
  112. array(
  113. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  114. array( 'property' => 'font-size', 'value' => '0.73em' ),
  115. array( 'property' => 'font-style', 'value' => 'italic' ),
  116. )
  117. );
  118. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  119. '.entry-meta',
  120. array(
  121. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  122. array( 'property' => 'font-size', 'value' => '0.73em' ),
  123. array( 'property' => 'font-style', 'value' => 'italic' ),
  124. )
  125. );
  126. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  127. '.site-main .portfolio-entry-meta',
  128. array(
  129. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  130. array( 'property' => 'font-size', 'value' => '0.73em' ),
  131. array( 'property' => 'font-style', 'value' => 'italic' ),
  132. )
  133. );
  134. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  135. '.comment-list .pingback .comment-body',
  136. array(
  137. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  138. array( 'property' => 'font-size', 'value' => '0.73em' ),
  139. array( 'property' => 'font-style', 'value' => 'italic' ),
  140. )
  141. );
  142. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  143. '.comment-meta-details',
  144. array(
  145. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  146. array( 'property' => 'font-size', 'value' => '0.73em' ),
  147. array( 'property' => 'font-style', 'value' => 'italic' ),
  148. )
  149. );
  150. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  151. '.no-comments',
  152. array(
  153. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  154. array( 'property' => 'font-size', 'value' => '0.73em' ),
  155. array( 'property' => 'font-style', 'value' => 'italic' ),
  156. )
  157. );
  158. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  159. '.wp-caption .wp-caption-dd,
  160. .wp-caption .wp-caption-text',
  161. array(
  162. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  163. array( 'property' => 'font-size', 'value' => '0.73em' ),
  164. array( 'property' => 'font-style', 'value' => 'italic' ),
  165. )
  166. );
  167. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  168. '.gallery .gallery-item .gallery-caption',
  169. array(
  170. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  171. array( 'property' => 'font-size', 'value' => '0.73em' ),
  172. array( 'property' => 'font-style', 'value' => 'italic' ),
  173. )
  174. );
  175. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  176. '.tiled-gallery .tiled-gallery-caption',
  177. array(
  178. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  179. array( 'property' => 'font-size', 'value' => '0.73em' ),
  180. array( 'property' => 'font-weight', 'value' => 'normal' ),
  181. array( 'property' => 'font-style', 'value' => 'italic' ),
  182. )
  183. );
  184. TypekitTheme::add_font_category_rule( $category_rules, 'body-text',
  185. '.entry-content > .jp-relatedposts .jp-relatedposts-post .jp-relatedposts-post-context,
  186. .entry-sharedaddy > .jp-relatedposts .jp-relatedposts-post .jp-relatedposts-post-context,
  187. .page-content > .jp-relatedposts .jp-relatedposts-post .jp-relatedposts-post-context,
  188. .page-content > .sharedaddy .jp-relatedposts .jp-relatedposts-post .jp-relatedposts-post-context,
  189. .entry-content > .sharedaddy .jp-relatedposts .jp-relatedposts-post .jp-relatedposts-post-context,
  190. .entry-sharedaddy > .sharedaddy .jp-relatedposts .jp-relatedposts-post .jp-relatedposts-post-context',
  191. array(
  192. array( 'property' => 'font-family', 'value' => '"PT Serif", serif' ),
  193. array( 'property' => 'font-style', 'value' => 'italic' ),
  194. )
  195. );
  196. return $category_rules;
  197. } );