wpcom-colors.php 12 KB

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