wpcom-colors.php 13 KB

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