wpcom-colors.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  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,
  180. input[type="color"],
  181. input[type="color"]:focus,
  182. input[type="date"],
  183. input[type="date"]:focus,
  184. input[type="datetime"],
  185. input[type="datetime"]:focus,
  186. input[type="datetime-local"],
  187. input[type="datetime-local"]:focus,
  188. input[type="email"],
  189. input[type="email"]:focus,
  190. input[type="month"],
  191. input[type="month"]:focus,
  192. input[type="number"],
  193. input[type="number"]:focus,
  194. input[type="password"],
  195. input[type="password"]:focus,
  196. input[type="range"],
  197. input[type="range"]:focus,
  198. input[type="search"],
  199. input[type="search"]:focus,
  200. input[type="tel"],
  201. input[type="tel"]:focus,
  202. input[type="text"],
  203. input[type="text"]:focus,
  204. input[type="time"],
  205. input[type="time"]:focus,
  206. input[type="url"],
  207. input[type="url"]:focus,
  208. input[type="week"],
  209. input[type="week"]:focus,
  210. textarea,
  211. textarea:focus', 'color' ),
  212. // Background-color
  213. array( '.wp-block-cover.has-background-dim,
  214. .wp-block-cover-image.has-background-dim,
  215. table.is-style-stripes tbody tr:nth-child(odd),
  216. .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
  217. body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'background-color' ),
  218. /**
  219. * Utility Classes
  220. */
  221. // Foreground
  222. array( '.has-foreground-color[class],
  223. .has-background-background-color[class],
  224. .has-background-dark-background-color[class],
  225. .has-background-light-background-color[class]', 'color' ),
  226. array( '.has-foreground-background-color[class]', 'background-color' ),
  227. // Text color
  228. array( '.has-background-background-color[class],
  229. .has-background-light-background-color[class],
  230. .has-background-dark-background-color[class]', 'color' ),
  231. // Text-color darkened
  232. array( '.has-foreground-dark-color[class]', 'color', '-1' ),
  233. // Background-color darkened
  234. array( '.has-foreground-dark-background-color[class]', 'background-color', '-1' ),
  235. // Text-color brightened
  236. array( '.has-foreground-light-color[class]', 'color', '+2' ),
  237. // Background-color brightened
  238. array( '.has-foreground-light-background-color[class]', 'background-color', '+2' ),
  239. /**
  240. * Gray (Same as text color)
  241. */
  242. // Text-color
  243. array( '.a8c-posts-list__item .a8c-posts-list-item__meta,
  244. .entry-footer,
  245. .entry-meta,
  246. .footer-navigation .footer-menu,
  247. .has-foreground-light-color[class],
  248. .site-branding,
  249. .site-info,
  250. .wp-block-image figcaption,
  251. .wp-block-latest-comments .wp-block-latest-comments__comment-date,
  252. .wp-block-latest-posts .wp-block-latest-posts__post-date,
  253. .wp-block-newspack-blocks-homepage-articles article .cat-links,
  254. .wp-block-newspack-blocks-homepage-articles article .entry-meta,
  255. .wp-block-pullquote .wp-block-pullquote__citation,
  256. .wp-block-pullquote cite,
  257. .wp-block-pullquote footer,
  258. .wp-block-quote .wp-block-quote__citation,
  259. .wp-block-quote cite,
  260. .wp-block-quote footer,
  261. .wp-block-quote.is-large .wp-block-quote__citation,
  262. .wp-block-quote.is-large cite,
  263. .wp-block-quote.is-large footer,
  264. .wp-block-quote.is-style-large .wp-block-quote__citation,
  265. .wp-block-quote.is-style-large cite,
  266. .wp-block-quote.is-style-large footer,
  267. .wp-block-video figcaption,
  268. figcaption', 'color' ),
  269. ), __( 'Text Color' ) );
  270. // Accent Color
  271. // $config-global--color-secondary-default
  272. add_color_rule( 'fg1', '#FF7A5C', array(
  273. // Text-color
  274. array( '.a8c-posts-list__item .a8c-posts-list-item__meta a:active,
  275. .a8c-posts-list__item .a8c-posts-list-item__meta a:hover,
  276. .comment-meta .comment-metadata a:active,
  277. .comment-meta .comment-metadata a:hover,
  278. .entry-footer a:active,
  279. .entry-footer a:hover,
  280. .entry-meta a:active,
  281. .entry-meta a:hover,
  282. .footer-navigation .footer-menu a:hover,
  283. .main-navigation a:hover,
  284. .site-info a:hover,
  285. .site-title a:hover,
  286. .social-navigation a:hover,
  287. .wp-block-button.is-style-outline .wp-block-button__link.has-focus,
  288. .wp-block-button.is-style-outline .wp-block-button__link:focus,
  289. .wp-block-button.is-style-outline .wp-block-button__link:hover,
  290. .wp-block-button.is-style-outline.wp-block-button__link.has-focus,
  291. .wp-block-button.is-style-outline.wp-block-button__link:focus,
  292. .wp-block-button.is-style-outline.wp-block-button__link:hover,
  293. .wp-block-newspack-blocks-homepage-articles article .cat-links a:active,
  294. .wp-block-newspack-blocks-homepage-articles article .cat-links a:hover,
  295. .wp-block-newspack-blocks-homepage-articles article .entry-meta a:active,
  296. .wp-block-newspack-blocks-homepage-articles article .entry-meta a:hover,
  297. .wp-block-newspack-blocks-homepage-articles article .entry-title a:hover,
  298. a:hover', 'color' ),
  299. // Background-color
  300. array( '.a8c-posts-list__view-all:focus,
  301. .a8c-posts-list__view-all:hover,
  302. .button:focus,
  303. .button:hover,
  304. .has-focus.a8c-posts-list__view-all,
  305. .has-focus.button,
  306. .has-focus.wp-block-button__link,
  307. .has-focus.wp-block-file__button,
  308. .main-navigation #toggle:focus + #toggle-menu,
  309. .wp-block-button__link:focus,
  310. .wp-block-button__link:hover,
  311. .wp-block-file__button:focus,
  312. .wp-block-file__button:hover,
  313. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:focus,
  314. body .widget_eu_cookie_law_widget #eu-cookie-law input.accept:hover,
  315. body .widget_eu_cookie_law_widget #eu-cookie-law input.has-focus.accept,
  316. button.has-focus,
  317. button:focus,
  318. button:hover,
  319. input.has-focus[type="submit"],
  320. input:focus[type="submit"],
  321. input:hover[type="submit"]', 'background-color' ),
  322. // Border-color
  323. array( 'input[type="color"]:focus,
  324. input[type="date"]:focus,
  325. input[type="datetime"]:focus,
  326. input[type="datetime-local"]:focus,
  327. input[type="email"]:focus,
  328. input[type="month"]:focus,
  329. input[type="number"]:focus,
  330. input[type="password"]:focus,
  331. input[type="range"]:focus,
  332. input[type="search"]:focus,
  333. input[type="tel"]:focus,
  334. input[type="text"]:focus,
  335. input[type="time"]:focus,
  336. input[type="url"]:focus,
  337. input[type="week"]:focus,
  338. textarea:focus', 'border-color' ),
  339. // Text-decoration-color
  340. array( '.entry-content a,
  341. .main-navigation > div > ul > li > a,
  342. .wp-block-newspack-blocks-homepage-articles article .entry-title a,
  343. a', 'text-decoration-color' ),
  344. /**
  345. * Utility Classes
  346. */
  347. // Text-color
  348. array( '.has-secondary-color[class]', 'color' ),
  349. // Background-color
  350. array( '.has-secondary-background-color[class]', 'background-color' ),
  351. ), __( 'Secondary Color' ) );
  352. /**
  353. * Featured Varia Palettes
  354. */
  355. // Light
  356. add_color_palette( array(
  357. '#FFFFFF',
  358. '#1D1E1E',
  359. '#C8133E',
  360. '#4E2F4B',
  361. ), 'Light' );
  362. // Medium
  363. add_color_palette( array(
  364. '#EEF4F7',
  365. '#242527',
  366. '#35845D',
  367. '#233252',
  368. ), 'Medium' );
  369. // Dark
  370. add_color_palette( array(
  371. '#1F2527',
  372. '#FFFFFF',
  373. '#9FD3E8',
  374. '#FBE6AA',
  375. ), 'Dark' );