wpcom-colors.php 12 KB

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