wpcom-editor-colors.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. /*
  3. * Custom Editor Colors: Seedlet
  4. */
  5. // Background Color
  6. // --global--color-background
  7. add_color_rule( 'bg', '#FFFFFF', array(
  8. // Background-color
  9. array( '#editor .editor-styles-wrapper .wp-block-navigation .wp-block-navigation__container,
  10. #editor .editor-styles-wrapper', 'background-color' ),
  11. // Text-color
  12. array( '#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
  13. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:active,
  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,
  18. #editor .editor-styles-wrapper .wp-block-button__link.has-focus,
  19. #editor .editor-styles-wrapper .wp-block-button__link:focus,
  20. #editor .editor-styles-wrapper .wp-block-button__link:hover,
  21. #editor .editor-styles-wrapper .wp-block-file .wp-block-file__button,
  22. #editor .editor-styles-wrapper .wp-block-file .wp-block-file__button.has-focus,
  23. #editor .editor-styles-wrapper .wp-block-file .wp-block-file__button:focus,
  24. #editor .editor-styles-wrapper .wp-block-file .wp-block-file__button:hover,
  25. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color,
  26. #editor .editor-styles-wrapper .wp-block-search .has-focus.wp-block-search__button,
  27. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button,
  28. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button:active,
  29. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button:focus,
  30. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button:hover', 'color' ),
  31. /**
  32. * Utility Classes
  33. */
  34. // Text-color
  35. array( '#editor .editor-styles-wrapper .has-primary-background-color,
  36. #editor .editor-styles-wrapper .has-secondary-background-color,
  37. #editor .editor-styles-wrapper .has-foreground-background-color,
  38. #editor .editor-styles-wrapper .has-foreground-dark-background-color,
  39. #editor .editor-styles-wrapper .has-foreground-light-background-color,
  40. #editor .editor-styles-wrapper .has-background-color', 'color' ),
  41. // Background-color
  42. array( '#editor .editor-styles-wrapper .has-background-background-color[class]', 'background-color' ),
  43. // Text-color darkened
  44. array( '#editor .editor-styles-wrapper .has-background-dark-color[class]', 'color', '-1' ),
  45. // Background-color darkened
  46. array( '#editor .editor-styles-wrapper .has-background-dark-background-color[class]', 'background-color', '-1' ),
  47. // Text-color lightened
  48. array( '#editor .editor-styles-wrapper .has-background-light-color[class]', 'color', '+1' ),
  49. // Background-color lightened
  50. array( '#editor .editor-styles-wrapper .has-background-light-background-color[class]', 'background-color', '+1' ),
  51. ), __( 'Background Color' ) );
  52. // Foreground Color
  53. // --global--color-background
  54. add_color_rule( 'txt', '#444444', array(
  55. // Text-color
  56. array( '#editor .editor-styles-wrapper,
  57. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .cat-links,
  58. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-meta,
  59. #editor .editor-styles-wrapper .wp-block-latest-posts .wp-block-latest-posts__post-date,
  60. #editor .editor-styles-wrapper .wp-block-pullquote .wp-block-pullquote__citation,
  61. #editor .editor-styles-wrapper .wp-block-pullquote cite,
  62. #editor .editor-styles-wrapper .wp-block-pullquote footer,
  63. #editor .editor-styles-wrapper .wp-block-quote .wp-block-quote__citation,
  64. #editor .editor-styles-wrapper .wp-caption,
  65. #editor .editor-styles-wrapper .wp-caption-text,
  66. #editor .editor-styles-wrapper blockquote cite,
  67. #editor .editor-styles-wrapper blockquote footer,
  68. #editor .editor-styles-wrapper figcaption', 'color' ),
  69. /**
  70. * Utility Classes
  71. */
  72. // Text-color
  73. array( '#editor .editor-styles-wrapper .has-background-background-color[class],
  74. #editor .editor-styles-wrapper .has-background-dark-background-color[class],
  75. #editor .editor-styles-wrapper .has-background-light-background-color[class],
  76. #editor .editor-styles-wrapper .has-foreground-color[class],
  77. #editor .editor-styles-wrapper .has-background-background-color[class] a', 'color' ),
  78. // Background-color
  79. array( '#editor .editor-styles-wrapper .has-foreground-background-color[class]', 'background-color' ),
  80. // Text-color darkened
  81. array( '#editor .editor-styles-wrapper .has-foreground-dark-color[class]', 'color', '-1' ),
  82. // Background-color darkened
  83. array( '#editor .editor-styles-wrapper .has-foreground-dark-background-color[class]', 'background-color', '-1' ),
  84. // Text-color brightened
  85. array( '#editor .editor-styles-wrapper .has-foreground-light-color[class]', 'color', '+2' ),
  86. // Background-color brightened
  87. array( '#editor .editor-styles-wrapper .has-foreground-light-background-color[class]', 'background-color', '+2' ),
  88. ), __( 'Text Color' ) );
  89. // Primary Color
  90. // --global--color-primary
  91. add_color_rule( 'link', '#000000', array(
  92. // Background-color
  93. array( '#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:active,
  94. #editor .editor-styles-wrapper .wp-block-cover,
  95. #editor .editor-styles-wrapper .wp-block-cover-image,
  96. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button:active', 'background-color' ),
  97. // Text-color
  98. array( '#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
  99. #editor .editor-styles-wrapper .wp-block-file .wp-block-file__textlink,
  100. #editor .editor-styles-wrapper a,
  101. #editor .editor-styles-wrapper a:active', 'color' ),
  102. /**
  103. * Utility Classes
  104. */
  105. // Background-color
  106. array( '#editor .editor-styles-wrapper .has-primary-background-color[class],
  107. #editor .editor-styles-wrapper .has-foreground-dark-background-color[class]', 'background-color' ),
  108. // Text-color
  109. array( '#editor .editor-styles-wrapper .has-primary-color[class],
  110. #editor .editor-styles-wrapper .has-black-background-color[class],
  111. #editor .editor-styles-wrapper .has-foreground-dark-color[class]', 'color' ),
  112. ), __( 'Primary Color' ) );
  113. // Secondary Color
  114. // --global--color-secondary
  115. add_color_rule( 'fg1', '#3C8067', array(
  116. // Text-color
  117. array( '#editor .editor-styles-wrapper .is-style-outline .wp-block-button__link,
  118. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .cat-links a:active,
  119. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .cat-links a:hover,
  120. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-meta a:active,
  121. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-meta a:hover,
  122. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:hover,
  123. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .more-link:active,
  124. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .more-link:hover,
  125. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline,
  126. #editor .editor-styles-wrapper .wp-block-navigation:not(.has-text-color) .wp-block-navigation-link > a:focus,
  127. #editor .editor-styles-wrapper .wp-block-navigation:not(.has-text-color) .wp-block-navigation-link > a:hover,
  128. #editor .editor-styles-wrapper a:focus,
  129. #editor .editor-styles-wrapper a:hover', 'color' ),
  130. // Background-color
  131. array( '#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
  132. #editor .editor-styles-wrapper .wp-block-button__link,
  133. #editor .editor-styles-wrapper .wp-block-file .wp-block-file__button,
  134. #editor .editor-styles-wrapper .wp-block-search .wp-block-search__button', 'background-color' ),
  135. // border-bottom-color
  136. array( '#editor .editor-styles-wrapper .wp-block-file .wp-block-file__textlink,
  137. #editor .editor-styles-wrapper a', 'border-bottom-color' ),
  138. // border-left-color
  139. array( '#editor .editor-styles-wrapper .wp-block-quote,
  140. #editor .editor-styles-wrapper .wp-block-quote.is-large,
  141. #editor .editor-styles-wrapper .wp-block-quote.is-style-large', 'border-left-color' ),
  142. // border-right-color
  143. array( '#editor .editor-styles-wrapper .wp-block-quote.has-text-align-right,
  144. #editor .editor-styles-wrapper .wp-block-quote.is-large.has-text-align-right,
  145. #editor .editor-styles-wrapper .wp-block-quote.is-style-large.has-text-align-right', 'border-right-color' ),
  146. /**
  147. * Utility Classes
  148. */
  149. // Background-color
  150. array( '#editor .editor-styles-wrapper .has-secondary-background-color[class]', 'background-color' ),
  151. // Text-color
  152. array( '#editor .editor-styles-wrapper .has-secondary-color[class],
  153. #editor .editor-styles-wrapper .has-white-background-color[class]', 'color' ),
  154. ), __( 'Secondary Color' ) );
  155. // Tertiary Color
  156. // --global--color-tertiary
  157. add_color_rule( 'fg2', '#FAFBF6', array(
  158. // Background-color
  159. array( '#editor .editor-styles-wrapper .has-tertiary-background-color[class]', 'background-color' ),
  160. // Text-color
  161. array( '#editor .editor-styles-wrapper .has-tertiary-color[class],
  162. #editor .editor-styles-wrapper .wp-block-cover-image:not([class*="background-color"]) .block-editor-block-list__block,
  163. #editor .editor-styles-wrapper .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-image-text,
  164. #editor .editor-styles-wrapper .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-text,
  165. #editor .editor-styles-wrapper .wp-block-cover-image:not([class*="background-color"]) .wp-block-cover__inner-container,
  166. #editor .editor-styles-wrapper .wp-block-cover:not([class*="background-color"]) .block-editor-block-list__block,
  167. #editor .editor-styles-wrapper .wp-block-cover:not([class*="background-color"]) .wp-block-cover-image-text,
  168. #editor .editor-styles-wrapper .wp-block-cover:not([class*="background-color"]) .wp-block-cover-text,
  169. #editor .editor-styles-wrapper .wp-block-cover:not([class*="background-color"]) .wp-block-cover__inner-container', 'color' ),
  170. ), __( 'Tertiary Color' ) );