wpcom-editor-colors.php 11 KB

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