wpcom-editor-colors.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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,
  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,
  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. // Text-color
  35. array( '#editor .editor-styles-wrapper', 'background-color' ),
  36. /**
  37. * Utility Classes
  38. */
  39. // Text-color
  40. array( '#editor .editor-styles-wrapper .has-background-color,
  41. #editor .editor-styles-wrapper .has-foreground-background-color,
  42. #editor .editor-styles-wrapper .has-foreground-dark-background-color,
  43. #editor .editor-styles-wrapper .has-foreground-light-background-color,
  44. #editor .editor-styles-wrapper .has-primary-background-color,
  45. #editor .editor-styles-wrapper .has-secondary-background-color,
  46. #editor .editor-styles-wrapper .wp-block .has-background-color,
  47. #editor .editor-styles-wrapper .wp-block .has-foreground-background-color,
  48. #editor .editor-styles-wrapper .wp-block .has-foreground-dark-background-color,
  49. #editor .editor-styles-wrapper .wp-block .has-foreground-light-background-color,
  50. #editor .editor-styles-wrapper .wp-block .has-primary-background-color,
  51. #editor .editor-styles-wrapper .wp-block .has-secondary-background-color', 'color' ),
  52. // Background-color
  53. array( '#editor .editor-styles-wrapper .has-background-background-color,
  54. #editor .editor-styles-wrapper .wp-block .has-background-background-color', 'background-color' ),
  55. // Text-color darkened
  56. array( '#editor .editor-styles-wrapper .has-background-dark-color,
  57. #editor .editor-styles-wrapper .wp-block .has-background-dark-color', 'color', '-1' ),
  58. // Background-color darkened
  59. array( '#editor .editor-styles-wrapper .has-background-dark-background-color,
  60. #editor .editor-styles-wrapper .wp-block .has-background-dark-background-color', 'background-color', '-1' ),
  61. // Text-color lightened
  62. array( '#editor .editor-styles-wrapper .has-background-light-color,
  63. #editor .editor-styles-wrapper .wp-block .has-background-light-color', 'color', '+1' ),
  64. // Background-color lightened
  65. array( '#editor .editor-styles-wrapper .has-background-light-background-color,
  66. #editor .editor-styles-wrapper .wp-block .has-background-light-background-color', 'background-color', '+1' ),
  67. ), __( 'Background Color' ) );
  68. // Link Color (Blue)
  69. // $config-global--color-primary-default
  70. add_editor_color_rule( 'link', '#C04239', array(
  71. // Text-color
  72. array( '#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
  73. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:hover,
  74. #editor .editor-styles-wrapper a', 'color' ),
  75. // Background-color
  76. array( '#editor .editor-styles-wrapper .button.has-focus,
  77. #editor .editor-styles-wrapper .button:focus,
  78. #editor .editor-styles-wrapper .button:hover,
  79. #editor .editor-styles-wrapper .has-primary-background-color,
  80. #editor .editor-styles-wrapper .wp-block .has-primary-background-color,
  81. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:focus,
  82. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:hover,
  83. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .has-focus.button,
  84. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-focus,
  85. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
  86. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
  87. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'background-color' ),
  88. array( '#editor .editor-styles-wrapper .wp-block-quote', 'border-left-color' ),
  89. /**
  90. * Utility Classes
  91. */
  92. // Text-color
  93. array( '#editor .editor-styles-wrapper .has-primary-color,
  94. #editor .editor-styles-wrapper .wp-block .has-primary-color', 'color' ),
  95. // Background-color
  96. array( '#editor .editor-styles-wrapper .has-primary-background-color,
  97. #editor .editor-styles-wrapper .wp-block .has-primary-background-color', 'background-color' ),
  98. ), __( 'Link Color' ) );
  99. // Text Color (Gray)
  100. // $config-global--color-foreground-default
  101. add_editor_color_rule( 'txt', '#252E36', array(
  102. // Text-color
  103. array( '#editor .editor-styles-wrapper .editor-post-title__block .editor-post-title__input,
  104. #editor .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link,
  105. #editor .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link.has-focus,
  106. #editor .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:focus,
  107. #editor .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:hover,
  108. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline,
  109. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline.has-focus,
  110. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:focus,
  111. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:hover,
  112. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
  113. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
  114. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline.has-focus,
  115. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:focus,
  116. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:hover,
  117. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .cat-links a:active,
  118. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .cat-links a:hover,
  119. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-meta a:active,
  120. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-meta a:hover,
  121. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:hover,
  122. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .more-link:active,
  123. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .more-link:hover,
  124. #editor .editor-styles-wrapper .wp-block-pullquote,
  125. #editor .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
  126. #editor .editor-styles-wrapper table.is-style-stripes tbody tr:nth-child(odd),
  127. #editor .editor-styles-wrapper .wp-block-separator.is-style-dots:before,
  128. #editor .editor-styles-wrapper hr.is-style-dots:before,
  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' ) );