wpcom-colors.php 12 KB

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