wpcom-editor-colors.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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-cover.has-background-dim,
  38. #editor .editor-styles-wrapper .wp-block-cover.has-background-dim a,
  39. #editor .editor-styles-wrapper .wp-block-cover-image.has-background-dim,
  40. #editor .editor-styles-wrapper .has-background a', 'color' ),
  41. /**
  42. * Utility Classes
  43. */
  44. // Text-color
  45. array( '#editor .editor-styles-wrapper .has-primary-background-color,
  46. #editor .editor-styles-wrapper .has-secondary-background-color,
  47. #editor .editor-styles-wrapper .has-foreground-background-color,
  48. #editor .editor-styles-wrapper .has-foreground-dark-background-color,
  49. #editor .editor-styles-wrapper .has-foreground-light-background-color,
  50. #editor .editor-styles-wrapper .has-background-color', 'color' ),
  51. // Background-color
  52. array( '#editor .editor-styles-wrapper .has-background-background-color[class]', 'background-color' ),
  53. // Text-color darkened
  54. array( '#editor .editor-styles-wrapper .has-background-dark-color[class]', 'color', '-1' ),
  55. // Background-color darkened
  56. array( '#editor .editor-styles-wrapper .has-background-dark-background-color[class]', 'background-color', '-1' ),
  57. // Text-color lightened
  58. array( '#editor .editor-styles-wrapper .has-background-light-color[class]', 'color', '+1' ),
  59. // Background-color lightened
  60. array( '#editor .editor-styles-wrapper .has-background-light-background-color[class]', 'background-color', '+1' ),
  61. /**
  62. * Clean up for nested items
  63. */
  64. // Text-color
  65. array( '#editor .editor-styles-wrapper .has-background:not(.has-background-background-color) .wp-block-quote .wp-block-quote__citation,
  66. #editor .editor-styles-wrapper [class*="background-color"]:not(.has-background-background-color) .wp-block-quote .wp-block-quote__citation,
  67. #editor .editor-styles-wrapper [style*="background-color"]:not(.has-background-background-color) .wp-block-quote .wp-block-quote__citation,
  68. #editor .editor-styles-wrapper .wp-block-cover[style*="background-image"] .wp-block-quote .wp-block-quote__citation', 'color' ),
  69. // Border-color
  70. array( '#editor .editor-styles-wrapper .has-background:not(.has-background-background-color) .wp-block-quote,
  71. #editor .editor-styles-wrapper [class*="background-color"]:not(.has-background-background-color) .wp-block-quote,
  72. #editor .editor-styles-wrapper [style*="background-color"]:not(.has-background-background-color) .wp-block-quote,
  73. #editor .editor-styles-wrapper .wp-block-cover[style*="background-image"] .wp-block-quote', 'border-color'),
  74. ), __( 'Background Color' ) );
  75. // Link Color (Blue)
  76. // $config-global--color-primary-default
  77. add_editor_color_rule( 'link', '#3E7D98', array(
  78. // Background-color
  79. array( '#editor .editor-styles-wrapper .button,
  80. #editor .editor-styles-wrapper .fse-template-part .main-navigation .button,
  81. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
  82. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background),
  83. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'background-color' ),
  84. // Text-color
  85. array( '#editor .editor-styles-wrapper .is-style-outline .wp-block-button__link:not(.has-text-color),
  86. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:not(.has-text-color),
  87. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
  88. #editor .editor-styles-wrapper .wp-block-separator.is-style-dots:before,
  89. #editor .editor-styles-wrapper a,
  90. #editor .editor-styles-wrapper hr.is-style-dots:before', 'color' ),
  91. // Border color top
  92. array( '#editor .editor-styles-wrapper .wp-block-pullquote', 'border-top-color' ),
  93. // Border color bottom
  94. array( '#editor .editor-styles-wrapper .wp-block-pullquote,
  95. #editor .editor-styles-wrapper .wp-block-separator,
  96. #editor .editor-styles-wrapper hr', 'border-bottom-color' ),
  97. // Border color left
  98. array( '#editor .editor-styles-wrapper .wp-block-quote', 'border-left-color' ),
  99. // Border color right
  100. array( '#editor .editor-styles-wrapper .wp-block-separator[style*="text-align: right"],
  101. #editor .editor-styles-wrapper .wp-block-separator[style*="text-align:right"],
  102. #editor .editor-styles-wrapper hr[style*="text-align: right"],
  103. #editor .editor-styles-wrapper hr[style*="text-align:right"]', 'border-right-color' ),
  104. /**
  105. * Utility Classes
  106. */
  107. // Background-color
  108. array( '#editor .editor-styles-wrapper .has-primary-background-color[class]', 'background-color' ),
  109. // Text-color
  110. array( '#editor .editor-styles-wrapper .has-primary-color[class]', 'color' ),
  111. ), __( 'Link Color' ) );
  112. // Text Color (Gray)
  113. // $config-global--color-foreground-default
  114. add_editor_color_rule( 'txt', '#394d55', array(
  115. // Text-color
  116. array( '#editor .editor-styles-wrapper,
  117. #editor .editor-styles-wrapper .editor-post-title__block .editor-post-title__input,
  118. #editor .editor-styles-wrapper .fse-template-part .main-navigation,
  119. #editor .editor-styles-wrapper .fse-template-part .main-navigation a,
  120. #editor .editor-styles-wrapper .fse-template-part .main-navigation a:link,
  121. #editor .editor-styles-wrapper .fse-template-part .main-navigation a:visited,
  122. #editor .editor-styles-wrapper .has-foreground-color[class],
  123. #editor .editor-styles-wrapper .wp-block-pullquote,
  124. #editor .editor-styles-wrapper .wp-block-quote .wp-block-quote__citation,
  125. #editor .editor-styles-wrapper .wp-block-pullquote:not(.is-style-solid-color) .wp-block-pullquote__citation,
  126. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:hover,
  127. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:focus,
  128. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline.has-focus,
  129. #editor .editor-styles-wrapper .is-style-outline .wp-block-button__link:hover,
  130. #editor .editor-styles-wrapper .is-style-outline .wp-block-button__link:focus,
  131. #editor .editor-styles-wrapper .is-style-outline .wp-block-button__link.has-focus', 'color' ),
  132. // Background-color
  133. array( '#editor .editor-styles-wrapper .wp-block-cover.has-background-dim,
  134. #editor .editor-styles-wrapper .wp-block-cover-image.has-background-dim,
  135. #editor .editor-styles-wrapper table.is-style-stripes tbody tr:nth-child(odd),
  136. #editor .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'background-color' ),
  137. /**
  138. * Utility Classes
  139. */
  140. // Text-color
  141. array( '#editor .editor-styles-wrapper .has-background-background-color[class],
  142. #editor .editor-styles-wrapper .has-background-dark-background-color[class],
  143. #editor .editor-styles-wrapper .has-background-light-background-color[class],
  144. #editor .editor-styles-wrapper .has-foreground-color[class],
  145. #editor .editor-styles-wrapper .has-background-background-color[class] a', 'color' ),
  146. // Background-color
  147. array( '#editor .editor-styles-wrapper .has-foreground-background-color[class]', 'background-color' ),
  148. // Text-color darkened
  149. array( '#editor .editor-styles-wrapper .has-foreground-dark-color[class]', 'color', '-1' ),
  150. // Background-color darkened
  151. array( '#editor .editor-styles-wrapper .has-foreground-dark-background-color[class]', 'background-color', '-1' ),
  152. // Text-color brightened
  153. array( '#editor .editor-styles-wrapper .has-foreground-light-color[class]', 'color', '+2' ),
  154. // Background-color brightened
  155. array( '#editor .editor-styles-wrapper .has-foreground-light-background-color[class]', 'background-color', '+2' ),
  156. ), __( 'Text Color' ) );
  157. // Accent Color (Red)
  158. // $config-global--color-secondary-default
  159. add_editor_color_rule( 'fg1', '#9B6A36', array(
  160. /**
  161. * Utility Classes
  162. */
  163. // Text-color
  164. array( '#editor .editor-styles-wrapper .has-secondary-color[class]', 'color' ),
  165. // Background-color
  166. array( '#editor .editor-styles-wrapper .has-secondary-background-color[class]', 'background-color' ),
  167. ), __( 'Secondary Color' ) );