wpcom-editor-colors.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. /*
  3. * Custom Editor Colors: Barnsbury
  4. */
  5. // Background Color (White)
  6. // $config-global--color-background-default
  7. add_editor_color_rule( 'bg', '#FFFDF6', 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__link:not(.has-text-color),
  18. #editor .editor-styles-wrapper .wp-block-button__link.has-focus:not(.has-text-color),
  19. #editor .editor-styles-wrapper .wp-block-button__link:not(.has-text-color):focus,
  20. #editor .editor-styles-wrapper .wp-block-button__link:not(.has-text-color):hover,
  21. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'color' ),
  22. // Background-color
  23. array( '#editor .editor-styles-wrapper', 'background-color' ),
  24. /**
  25. * Utility Classes
  26. */
  27. // Text-color
  28. array( '#editor .editor-styles-wrapper .has-primary-background-color,
  29. #editor .editor-styles-wrapper .wp-block .has-primary-background-color,
  30. #editor .editor-styles-wrapper .has-secondary-background-color,
  31. #editor .editor-styles-wrapper .wp-block .has-secondary-background-color,
  32. #editor .editor-styles-wrapper .has-foreground-background-color,
  33. #editor .editor-styles-wrapper .wp-block .has-foreground-background-color,
  34. #editor .editor-styles-wrapper .has-foreground-dark-background-color,
  35. #editor .editor-styles-wrapper .wp-block .has-foreground-dark-background-color,
  36. #editor .editor-styles-wrapper .has-foreground-light-background-color,
  37. #editor .editor-styles-wrapper .wp-block .has-foreground-light-background-color,
  38. #editor .editor-styles-wrapper .has-background-color,
  39. #editor .editor-styles-wrapper .wp-block .has-background-color', 'color' ),
  40. // Background-color
  41. array( '#editor .editor-styles-wrapper .has-background-background-color,
  42. #editor .editor-styles-wrapper .wp-block .has-background-background-color', 'background-color' ),
  43. // Text-color darkened
  44. array( '#editor .editor-styles-wrapper .has-background-dark-color,
  45. #editor .editor-styles-wrapper .wp-block .has-background-dark-color', 'color', '-1' ),
  46. // Background-color darkened
  47. array( '#editor .editor-styles-wrapper .has-background-dark-background-color,
  48. #editor .editor-styles-wrapper .wp-block .has-background-dark-background-color', 'background-color', '-1' ),
  49. // Text-color lightened
  50. array( '#editor .editor-styles-wrapper .has-background-light-color,
  51. #editor .editor-styles-wrapper .wp-block .has-background-light-color', 'color', '+1' ),
  52. // Background-color lightened
  53. array( '#editor .editor-styles-wrapper .has-background-light-background-color,
  54. #editor .editor-styles-wrapper .wp-block .has-background-light-background-color', 'background-color', '+1' ),
  55. ), __( 'Background Color' ) );
  56. // Link Color (Blue)
  57. // $config-global--color-primary-default
  58. add_editor_color_rule( 'link', '#20603C', array(
  59. // Text-color
  60. array( '#editor .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
  61. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:not(.has-text-color),
  62. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
  63. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:active,
  64. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:focus,
  65. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:hover,
  66. #editor .editor-styles-wrapper .wp-block-latest-posts > li > a:active,
  67. #editor .editor-styles-wrapper .wp-block-latest-posts > li > a:focus,
  68. #editor .editor-styles-wrapper .wp-block-latest-posts > li > a:hover', 'color' ),
  69. // Background-color
  70. array( '#editor .editor-styles-wrapper .button,
  71. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
  72. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background),
  73. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline,
  74. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'background-color' ),
  75. // Border-left-color
  76. array( '#editor .editor-styles-wrapper .wp-block-quote', 'border-left-color' ),
  77. /**
  78. * Utility Classes
  79. */
  80. // Background-color
  81. array( '#editor .editor-styles-wrapper .has-primary-background-color,
  82. #editor .editor-styles-wrapper .wp-block .has-primary-background-color', 'background-color' ),
  83. // Text-color
  84. array( '#editor .editor-styles-wrapper .has-primary-color,
  85. #editor .editor-styles-wrapper .wp-block .has-primary-color', 'color' ),
  86. ), __( 'Link Color' ) );
  87. // Text Color
  88. // $config-global--color-foreground-default
  89. add_editor_color_rule( 'txt', '#3C2323', array(
  90. // Text-color
  91. array( '#editor .editor-styles-wrapper .editor-post-title__block .editor-post-title__input,
  92. #editor .editor-styles-wrapper .wp-block-latest-posts > li > a,
  93. #editor .editor-styles-wrapper .wp-block-pullquote,
  94. #editor .editor-styles-wrapper .wp-block-separator.is-style-dots:before,
  95. #editor .editor-styles-wrapper hr.is-style-dots:before,
  96. #editor .editor-styles-wrapper table.is-style-stripes tbody tr:nth-child(odd),
  97. #editor .editor-styles-wrapper', 'color' ),
  98. // Border-top-color
  99. array( '#editor .editor-styles-wrapper .wp-block-pullquote', 'border-top-color' ),
  100. // Border-bottom-color
  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-right-color
  105. array( '#editor .editor-styles-wrapper .wp-block-separator[style*="text-align: right"],
  106. #editor .editor-styles-wrapper .wp-block-separator[style*="text-align:right"],
  107. #editor .editor-styles-wrapper hr[style*="text-align: right"],
  108. #editor .editor-styles-wrapper hr[style*="text-align:right"]', 'border-right-color' ),
  109. /**
  110. * Utility Classes
  111. */
  112. // Text-color
  113. array( '#editor .editor-styles-wrapper .has-background-background-color,
  114. #editor .editor-styles-wrapper .wp-block .has-background-background-color,
  115. #editor .editor-styles-wrapper .has-background-dark-background-color,
  116. #editor .editor-styles-wrapper .wp-block .has-background-dark-background-color,
  117. #editor .editor-styles-wrapper .has-background-light-background-color,
  118. #editor .editor-styles-wrapper .wp-block .has-background-light-background-color,
  119. #editor .editor-styles-wrapper .has-foreground-color,
  120. #editor .editor-styles-wrapper .wp-block .has-foreground-color', 'color' ),
  121. // Background-color
  122. array( '#editor .editor-styles-wrapper .has-foreground-background-color,
  123. #editor .editor-styles-wrapper .wp-block .has-foreground-background-color', 'background-color' ),
  124. // Text-color darkened
  125. array( '#editor .editor-styles-wrapper .has-foreground-dark-color,
  126. #editor .editor-styles-wrapper .wp-block .has-foreground-dark-color', 'color', '-1' ),
  127. // Background-color darkened
  128. array( '#editor .editor-styles-wrapper .has-foreground-dark-background-color,
  129. #editor .editor-styles-wrapper .wp-block .has-foreground-dark-background-color', 'background-color', '-1' ),
  130. // Text-color brightened
  131. array( '#editor .editor-styles-wrapper .has-foreground-light-color,
  132. #editor .editor-styles-wrapper .wp-block .has-foreground-light-color', 'color', '+2' ),
  133. // Background-color brightened
  134. array( '#editor .editor-styles-wrapper .has-foreground-light-background-color,
  135. #editor .editor-styles-wrapper .wp-block .has-foreground-light-background-color', 'background-color', '+2' ),
  136. ), __( 'Text Color' ) );
  137. // Accent Color
  138. // $config-global--color-secondary-default
  139. add_editor_color_rule( 'fg1', '#655441', array(
  140. /**
  141. * Utility Classes
  142. */
  143. // Text-color
  144. array( '#editor .editor-styles-wrapper .has-secondary-color,
  145. #editor .editor-styles-wrapper .wp-block .has-secondary-color', 'color' ),
  146. // Background-color
  147. array( '#editor .editor-styles-wrapper .has-secondary-background-color,
  148. #editor .editor-styles-wrapper .wp-block .has-secondary-background-color', 'background-color' ),
  149. ), __( 'Secondary Color' ) );