wpcom-editor-colors.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <?php
  2. /*
  3. * Custom Editor Colors: Varia
  4. */
  5. // Background Color (White)
  6. // $config-global--color-background-default
  7. add_editor_color_rule( 'bg', '#ffffff', array(
  8. // Background-color
  9. array( '#editor .editor-styles-wrapper,
  10. #editor .editor-styles-wrapper .fse-template-part .main-navigation > div > ul > li > .sub-menu', 'background-color' ),
  11. // Text-color
  12. array( '#editor .editor-styles-wrapper .button,
  13. #editor .editor-styles-wrapper .button.has-focus,
  14. #editor .editor-styles-wrapper .button:focus,
  15. #editor .editor-styles-wrapper .button:hover,
  16. #editor .editor-styles-wrapper .fse-template-part .main-navigation .button,
  17. #editor .editor-styles-wrapper .fse-template-part .main-navigation .button:focus,
  18. #editor .editor-styles-wrapper .fse-template-part .main-navigation .button:hover,
  19. #editor .editor-styles-wrapper .fse-template-part .main-navigation .has-focus.button,
  20. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
  21. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:focus,
  22. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:hover,
  23. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .has-focus.button,
  24. #editor .editor-styles-wrapper table.is-style-stripes tbody tr:nth-child(odd),
  25. #editor .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
  26. #editor .editor-styles-wrapper .wp-block-button .wp-block-button__link,
  27. #editor .editor-styles-wrapper .wp-block-button .wp-block-button__link.has-focus,
  28. #editor .editor-styles-wrapper .wp-block-button .wp-block-button__link:focus,
  29. #editor .editor-styles-wrapper .wp-block-button .wp-block-button__link:hover,
  30. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color,
  31. #editor .editor-styles-wrapper .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-image-text,
  32. #editor .editor-styles-wrapper .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-text,
  33. #editor .editor-styles-wrapper .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover__inner-container,
  34. #editor .editor-styles-wrapper .wp-block-cover:not([class*="background-color"]) .wp-block-cover-image-text,
  35. #editor .editor-styles-wrapper .wp-block-cover:not([class*="background-color"]) .wp-block-cover-text,
  36. #editor .editor-styles-wrapper .wp-block-cover:not([class*="background-color"]) .wp-block-cover__inner-container,
  37. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button,
  38. #editor .editor-styles-wrapper .wp-block-cover.has-background-dim,
  39. #editor .editor-styles-wrapper .wp-block-cover.has-background-dim a,
  40. #editor .editor-styles-wrapper .wp-block-cover-image.has-background-dim,
  41. #editor .editor-styles-wrapper .has-background a', 'color' ),
  42. /**
  43. * Utility Classes
  44. */
  45. // Text-color
  46. array( '#editor .editor-styles-wrapper .has-primary-background-color,
  47. #editor .editor-styles-wrapper .has-secondary-background-color,
  48. #editor .editor-styles-wrapper .has-foreground-background-color,
  49. #editor .editor-styles-wrapper .has-foreground-dark-background-color,
  50. #editor .editor-styles-wrapper .has-foreground-light-background-color,
  51. #editor .editor-styles-wrapper .has-background-color', 'color' ),
  52. // Background-color
  53. array( '#editor .editor-styles-wrapper .has-background-background-color[class]', 'background-color' ),
  54. // Text-color darkened
  55. array( '#editor .editor-styles-wrapper .has-background-dark-color[class]', 'color', '-1' ),
  56. // Background-color darkened
  57. array( '#editor .editor-styles-wrapper .has-background-dark-background-color[class]', 'background-color', '-1' ),
  58. // Text-color lightened
  59. array( '#editor .editor-styles-wrapper .has-background-light-color[class]', 'color', '+1' ),
  60. // Background-color lightened
  61. array( '#editor .editor-styles-wrapper .has-background-light-background-color[class]', 'background-color', '+1' ),
  62. /**
  63. * Clean up for nested items
  64. */
  65. // Text-color
  66. array( '#editor .editor-styles-wrapper .has-background:not(.has-background-background-color) .wp-block-quote .wp-block-quote__citation,
  67. #editor .editor-styles-wrapper [class*="background-color"]:not(.has-background-background-color) .wp-block-quote .wp-block-quote__citation,
  68. #editor .editor-styles-wrapper [style*="background-color"]:not(.has-background-background-color) .wp-block-quote .wp-block-quote__citation,
  69. #editor .editor-styles-wrapper .wp-block-cover[style*="background-image"] .wp-block-quote .wp-block-quote__citation', 'color' ),
  70. // Border-color
  71. array( '#editor .editor-styles-wrapper .has-background:not(.has-background-background-color) .wp-block-quote,
  72. #editor .editor-styles-wrapper [class*="background-color"]:not(.has-background-background-color) .wp-block-quote,
  73. #editor .editor-styles-wrapper [style*="background-color"]:not(.has-background-background-color) .wp-block-quote,
  74. #editor .editor-styles-wrapper .wp-block-cover[style*="background-image"] .wp-block-quote', 'border-color'),
  75. ), __( 'Background Color' ) );
  76. // Link Color (Blue)
  77. // $config-global--color-primary-default
  78. add_editor_color_rule( 'link', '#3E7D98', array(
  79. // Background-color
  80. array( '#editor .editor-styles-wrapper .button,
  81. #editor .editor-styles-wrapper .fse-template-part .main-navigation .button,
  82. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
  83. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background),
  84. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button,
  85. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button:focus,
  86. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button:hover,
  87. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'background-color' ),
  88. // Text-color
  89. array( '#editor .editor-styles-wrapper .is-style-outline .wp-block-button__link:not(.has-text-color),
  90. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:not(.has-text-color),
  91. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
  92. #editor .editor-styles-wrapper .wp-block-separator.is-style-dots:before,
  93. #editor .editor-styles-wrapper a,
  94. #editor .editor-styles-wrapper hr.is-style-dots:before', 'color' ),
  95. // Border-color (forms)
  96. array( '#editor .editor-styles-wrapper .wp-block-search .wp-block-search__input:focus,
  97. textarea:focus', 'border-color' ),
  98. // Border color top
  99. array( '#editor .editor-styles-wrapper .wp-block-pullquote', 'border-top-color' ),
  100. // Border color bottom
  101. array( '#editor .editor-styles-wrapper .wp-block-pullquote,
  102. #editor .editor-styles-wrapper .wp-block-separator,
  103. #editor .editor-styles-wrapper hr', 'border-bottom-color' ),
  104. // Border color left
  105. array( '#editor .editor-styles-wrapper .wp-block-quote', 'border-left-color' ),
  106. // Border color right
  107. array( '#editor .editor-styles-wrapper .wp-block-separator[style*="text-align: right"],
  108. #editor .editor-styles-wrapper .wp-block-separator[style*="text-align:right"],
  109. #editor .editor-styles-wrapper hr[style*="text-align: right"],
  110. #editor .editor-styles-wrapper hr[style*="text-align:right"]', 'border-right-color' ),
  111. /**
  112. * Utility Classes
  113. */
  114. // Background-color
  115. array( '#editor .editor-styles-wrapper .has-primary-background-color[class]', 'background-color' ),
  116. // Text-color
  117. array( '#editor .editor-styles-wrapper .has-primary-color[class]', 'color' ),
  118. ), __( 'Link Color' ) );
  119. // Text Color (Gray)
  120. // $config-global--color-foreground-default
  121. add_editor_color_rule( 'txt', '#394d55', array(
  122. // Text-color
  123. array( '#editor .editor-styles-wrapper,
  124. #editor .editor-styles-wrapper .editor-post-title__block .editor-post-title__input,
  125. #editor .editor-styles-wrapper .fse-template-part .main-navigation,
  126. #editor .editor-styles-wrapper .fse-template-part .main-navigation a,
  127. #editor .editor-styles-wrapper .fse-template-part .main-navigation a:link,
  128. #editor .editor-styles-wrapper .fse-template-part .main-navigation a:visited,
  129. #editor .editor-styles-wrapper .has-foreground-color[class],
  130. #editor .editor-styles-wrapper .wp-block-pullquote,
  131. #editor .editor-styles-wrapper .wp-block-quote .wp-block-quote__citation,
  132. #editor .editor-styles-wrapper .wp-block-pullquote:not(.is-style-solid-color) .wp-block-pullquote__citation,
  133. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:hover,
  134. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:focus,
  135. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline.has-focus,
  136. #editor .editor-styles-wrapper .is-style-outline .wp-block-button__link:hover,
  137. #editor .editor-styles-wrapper .is-style-outline .wp-block-button__link:focus,
  138. #editor .editor-styles-wrapper .is-style-outline .wp-block-button__link.has-focus', 'color' ),
  139. // Border-color with less opacity (dim)
  140. array( '#editor .editor-styles-wrapper .wp-block-code,
  141. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__input', 'border-color', 0.8 ),
  142. // Background-color
  143. array( '#editor .editor-styles-wrapper .wp-block-cover.has-background-dim,
  144. #editor .editor-styles-wrapper .wp-block-cover-image.has-background-dim,
  145. #editor .editor-styles-wrapper table.is-style-stripes tbody tr:nth-child(odd),
  146. #editor .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'background-color' ),
  147. /**
  148. * Utility Classes
  149. */
  150. // Text-color
  151. array( '#editor .editor-styles-wrapper .has-background-background-color[class],
  152. #editor .editor-styles-wrapper .has-background-dark-background-color[class],
  153. #editor .editor-styles-wrapper .has-background-light-background-color[class],
  154. #editor .editor-styles-wrapper .has-foreground-color[class],
  155. #editor .editor-styles-wrapper .has-background-background-color[class] a', 'color' ),
  156. // Background-color
  157. array( '#editor .editor-styles-wrapper .has-foreground-background-color[class]', 'background-color' ),
  158. // Text-color darkened
  159. array( '#editor .editor-styles-wrapper .has-foreground-dark-color[class]', 'color', '-1' ),
  160. // Background-color darkened
  161. array( '#editor .editor-styles-wrapper .has-foreground-dark-background-color[class]', 'background-color', '-1' ),
  162. // Text-color brightened
  163. array( '#editor .editor-styles-wrapper .has-foreground-light-color[class]', 'color', '+2' ),
  164. // Background-color brightened
  165. array( '#editor .editor-styles-wrapper .has-foreground-light-background-color[class]', 'background-color', '+2' ),
  166. ), __( 'Text Color' ) );
  167. // Accent Color (Red)
  168. // $config-global--color-secondary-default
  169. add_editor_color_rule( 'fg1', '#9B6A36', array(
  170. /**
  171. * Utility Classes
  172. */
  173. // Text-color
  174. array( '#editor .editor-styles-wrapper .has-secondary-color[class]', 'color' ),
  175. // Background-color
  176. array( '#editor .editor-styles-wrapper .has-secondary-background-color[class]', 'background-color' ),
  177. ), __( 'Secondary Color' ) );