wpcom-colors.php 14 KB

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