wpcom-colors.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <?php
  2. /* Custom Colors: Leven */
  3. // Background Color
  4. // $config-global--color-background-default
  5. add_color_rule( 'bg', '#f7f7f6', array(
  6. // Background-color
  7. array( '.screen-reader-text:focus,
  8. body,
  9. body .widget_eu_cookie_law_widget #eu-cookie-law,
  10. body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept,
  11. .main-navigation > div > ul > li > .sub-menu', 'background-color' ),
  12. // Text-color
  13. array( '.a8c-posts-list-item__featured span,
  14. .sticky-post,
  15. .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-image-text,
  16. .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-text,
  17. .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover__inner-container,
  18. .wp-block-cover:not([class*="background-color"]) .wp-block-cover-image-text,
  19. .wp-block-cover:not([class*="background-color"]) .wp-block-cover-text,
  20. .wp-block-cover:not([class*="background-color"]) .wp-block-cover__inner-container,
  21. .wp-block-pullquote.is-style-solid-color,
  22. body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'color' ),
  23. /**
  24. * Utility Classes
  25. */
  26. // Text-color
  27. array( '.has-primary-background-color[class],
  28. .has-secondary-background-color[class],
  29. .has-foreground-background-color[class],
  30. .has-foreground-dark-background-color[class],
  31. .has-foreground-light-background-color[class],
  32. .has-background-color[class]', 'color' ),
  33. // Background-color
  34. array( '.has-background-background-color[class],
  35. .has-background-background-color.has-background-dim[class]', 'background-color' ),
  36. // Text-color darkened
  37. array( '.has-background-dark-color[class]', 'background-color', '-1' ),
  38. // Background-color darkened
  39. array( '.has-background-dark-background-color[class],
  40. .has-background-dark-background-color.has-background-dim[class]', 'background-color', '-1' ),
  41. // Text-color lightened
  42. array( '.has-background-light-color[class]', 'background-color', '+1' ),
  43. // Background-color lightened
  44. array( '.has-background-light-background-color[class],
  45. .has-background-light-background-color.has-background-dim[class]', 'background-color', '+1' ),
  46. /**
  47. * Grays
  48. * Uses a slightly darker color
  49. */
  50. // Border-color
  51. array( '.wp-block-code,
  52. body .widget_eu_cookie_law_widget #eu-cookie-law,
  53. input[type="color"],
  54. input[type="date"],
  55. input[type="datetime"],
  56. input[type="datetime-local"],
  57. input[type="email"],
  58. input[type="month"],
  59. input[type="number"],
  60. input[type="password"],
  61. input[type="range"],
  62. input[type="search"],
  63. input[type="tel"],
  64. input[type="text"],
  65. input[type="time"],
  66. input[type="url"],
  67. input[type="week"],
  68. select,
  69. textarea', 'border-color', '-1' ),
  70. // Border-top-color
  71. array( '.comment-list .children > li,
  72. .comment-list > li,
  73. .wp-block-pullquote', 'border-top-color', '-1' ),
  74. // Border-bottom-color
  75. array( '.comment-list,
  76. .wp-block-pullquote,
  77. hr,
  78. hr.wp-block-separator', 'border-bottom-color', '-1' ),
  79. // Color
  80. array( 'hr.wp-block-separator.is-style-dots:before', 'color', '-1' ),
  81. // Background-color
  82. array( 'body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept.has-focus,
  83. body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept:focus,
  84. body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept:hover', '-1' ),
  85. ), __( 'Background Color' ) );
  86. // Link Color
  87. // $config-global--color-primary-default
  88. add_color_rule( 'link', '#ff302c', array(
  89. // Background-color
  90. array( '.a8c-posts-list-item__featured span,
  91. .a8c-posts-list__view-all,
  92. .button,
  93. .sticky-post,
  94. .wp-block-button__link,
  95. .wp-block-file .wp-block-file__button,
  96. .wp-block-file__button,
  97. .wp-block-pullquote.is-style-solid-color,
  98. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept,
  99. button,
  100. button[data-load-more-btn],
  101. input[type="submit"]', 'background-color' ),
  102. // Text-color
  103. array( '.site-title a:hover,
  104. .social-navigation a,
  105. .wp-block-button.is-style-outline .wp-block-button__link,
  106. .wp-block-button.is-style-outline .wp-block-button__link:active,
  107. .wp-block-button.is-style-outline.wp-block-button__link,
  108. .wp-block-button.is-style-outline.wp-block-button__link:active,
  109. .wp-block-newspack-blocks-homepage-articles article .entry-title a,
  110. a', 'color' ),
  111. // Border color left
  112. array( '.wp-block-quote', 'border-left-color' ),
  113. // Border color right
  114. array( '.wp-block-quote[style*="text-align: right"],
  115. .wp-block-quote[style*="text-align:right"]', 'border-right-color' ),
  116. /**
  117. * Utility Classes
  118. */
  119. // Background-color
  120. array( '.has-primary-background-color[class],
  121. .has-primary-background-color.has-background-dim[class]', 'background-color' ),
  122. // Text-color
  123. array( '.has-primary-color[class]', 'color' ),
  124. ), __( 'Link Color' ) );
  125. // Text Color
  126. // $config-global--color-foreground-default
  127. add_color_rule( 'txt', '#444444', array(
  128. // Text-color
  129. array( '.site-title,
  130. .main-navigation,
  131. .main-navigation a:hover,
  132. .screen-reader-text:focus,
  133. .comment-meta .comment-metadata,
  134. .wp-block-code,
  135. .wp-block-code pre,
  136. .wp-block-pullquote,
  137. body,
  138. body .widget_eu_cookie_law_widget #eu-cookie-law,
  139. body .widget_eu_cookie_law_widget #eu-cookie-law.negative input.accept,
  140. .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
  141. table.is-style-stripes tbody tr:nth-child(odd)', 'color' ),
  142. // Background-color
  143. array( '.wp-block-cover,
  144. .wp-block-cover.has-background-dim,
  145. .wp-block-cover-image,
  146. .wp-block-cover-image.has-background-dim,
  147. body .widget_eu_cookie_law_widget #eu-cookie-law.negative,
  148. .main-navigation #toggle:focus + #toggle-menu', 'background-color' ),
  149. // Border-color darkened
  150. array( 'body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'background-color', '-1' ),
  151. /**
  152. * Utility Classes
  153. */
  154. // Foreground
  155. array( '.has-foreground-color[class],
  156. .has-background-background-color[class],
  157. .has-background-background-color.has-background-dim[class],
  158. .has-background-dark-background-color[class],
  159. .has-background-dark-background-color.has-background-dim[class],
  160. .has-background-light-background-color[class],
  161. .has-background-light-background-color.has-background-dim[class]', 'color' ),
  162. array( '.has-foreground-background-color[class],
  163. .has-foreground-background-color.has-background-dim[class]', 'background-color' ),
  164. // Text-color darkened
  165. array( '.has-foreground-dark-color[class]', 'color', '-1' ),
  166. // Background-color darkened
  167. array( '.has-foreground-dark-background-color[class],
  168. .has-foreground-dark-background-color.has-background-dim[class]', 'background-color', '-1' ),
  169. // Text-color brightened
  170. array( '.has-foreground-light-color[class]', 'color', '+2' ),
  171. // Background-color brightened
  172. array( '.has-foreground-light-background-color[class],
  173. .has-foreground-light-background-color.has-background-dim[class]', 'background-color', '+2' ),
  174. /**
  175. * Gray (Same as text color)
  176. */
  177. // Text-color
  178. array( '.a8c-posts-list__item .a8c-posts-list-item__meta,
  179. .entry-footer,
  180. .entry-meta,
  181. .footer-navigation .footer-menu,
  182. .site-branding,
  183. .site-info,
  184. .wp-block-image figcaption,
  185. .wp-block-latest-comments .wp-block-latest-comments__comment-date,
  186. .wp-block-latest-posts .wp-block-latest-posts__post-date,
  187. .wp-block-newspack-blocks-homepage-articles article .cat-links,
  188. .wp-block-newspack-blocks-homepage-articles article .entry-meta,
  189. .wp-block-pullquote .wp-block-pullquote__citation,
  190. .wp-block-pullquote cite,
  191. .wp-block-pullquote footer,
  192. .wp-block-quote .wp-block-quote__citation,
  193. .wp-block-quote cite,
  194. .wp-block-quote footer,
  195. .wp-block-quote.is-large .wp-block-quote__citation,
  196. .wp-block-quote.is-large cite,
  197. .wp-block-quote.is-large footer,
  198. .wp-block-quote.is-style-large .wp-block-quote__citation,
  199. .wp-block-quote.is-style-large cite,
  200. .wp-block-quote.is-style-large footer,
  201. .wp-block-table figcaption,
  202. .wp-block-video figcaption,
  203. figcaption', 'color' ),
  204. ), __( 'Text Color' ) );
  205. // Accent Color
  206. // $config-global--color-secondary-default
  207. add_color_rule( 'fg1', '#1285ce', array(
  208. // Text-color
  209. array( '.a8c-posts-list__item .a8c-posts-list-item__meta a:active,
  210. .a8c-posts-list__item .a8c-posts-list-item__meta a:hover,
  211. .comment-meta .comment-metadata a:active,
  212. .comment-meta .comment-metadata a:hover,
  213. .entry-footer a:active,
  214. .entry-footer a:hover,
  215. .entry-meta a:active,
  216. .entry-meta a:hover,
  217. .footer-navigation .footer-menu a:hover,
  218. .main-navigation a,
  219. .main-navigation a:link,
  220. .main-navigation a:visited,
  221. .site-info a:hover,
  222. .social-navigation a:hover,
  223. .wp-block-button.is-style-outline .wp-block-button__link.has-focus,
  224. .wp-block-button.is-style-outline .wp-block-button__link:focus,
  225. .wp-block-button.is-style-outline .wp-block-button__link:hover,
  226. .wp-block-button.is-style-outline.wp-block-button__link.has-focus,
  227. .wp-block-button.is-style-outline.wp-block-button__link:focus,
  228. .wp-block-button.is-style-outline.wp-block-button__link:hover,
  229. .wp-block-newspack-blocks-homepage-articles article .cat-links a:active,
  230. .wp-block-newspack-blocks-homepage-articles article .cat-links a:hover,
  231. .wp-block-newspack-blocks-homepage-articles article .entry-meta a:active,
  232. .wp-block-newspack-blocks-homepage-articles article .entry-meta a:hover,
  233. .wp-block-newspack-blocks-homepage-articles article .entry-title a:hover,
  234. a:hover', 'color' ),
  235. // Background-color
  236. array( '.a8c-posts-list__view-all:focus,
  237. .a8c-posts-list__view-all:hover,
  238. .button:focus,
  239. .button:hover,
  240. .has-focus.a8c-posts-list__view-all,
  241. .has-focus.button,
  242. .has-focus.wp-block-button__link,
  243. .has-focus.wp-block-file__button,
  244. .wp-block-button__link:focus,
  245. .wp-block-button__link:hover,
  246. .wp-block-file__button:focus,
  247. .wp-block-file__button:hover,
  248. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:focus,
  249. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:hover,
  250. body .widget_eu_cookie_law_widget #eu-cookie-law input.has-focus.accept,
  251. button.has-focus,
  252. button:focus,
  253. button:hover', 'background-color' ),
  254. // Border color
  255. array( 'input[type="color"]:focus,
  256. input[type="date"]:focus,
  257. input[type="datetime"]:focus,
  258. input[type="datetime-local"]:focus,
  259. input[type="email"]:focus,
  260. input[type="month"]:focus,
  261. input[type="number"]:focus,
  262. input[type="password"]:focus,
  263. input[type="range"]:focus,
  264. input[type="search"]:focus,
  265. input[type="tel"]:focus,
  266. input[type="text"]:focus,
  267. input[type="time"]:focus,
  268. input[type="url"]:focus,
  269. input[type="week"]:focus,
  270. textarea:focus', 'border-color' ),
  271. /**
  272. * Utility Classes
  273. */
  274. // Text-color
  275. array( '.has-secondary-color[class]', 'color' ),
  276. // Background-color
  277. array( '.has-secondary-background-color[class],
  278. .has-secondary-background-color.has-background-dim[class]', 'background-color' ),
  279. ), __( 'Secondary Color' ) );
  280. /**
  281. * Featured Varia Palettes
  282. */
  283. // Light
  284. add_color_palette( array(
  285. '#FFFFFF',
  286. '#1D1E1E',
  287. '#C8133E',
  288. '#4E2F4B',
  289. ), 'Light' );
  290. // Medium
  291. add_color_palette( array(
  292. '#EEF4F7',
  293. '#242527',
  294. '#35845D',
  295. '#233252',
  296. ), 'Medium' );
  297. // Dark
  298. add_color_palette( array(
  299. '#1F2527',
  300. '#FFFFFF',
  301. '#9FD3E8',
  302. '#FBE6AA',
  303. ), 'Dark' );