wpcom-editor-colors.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?php
  2. /*
  3. * Custom Editor Colors
  4. */
  5. // Background Color
  6. // $config-global--color-background-default
  7. add_editor_color_rule( 'bg', '#060f29', array(
  8. // Background-color
  9. array( '#editor .editor-styles-wrapper', 'background-color' ),
  10. // Text-color
  11. array( '#editor .editor-styles-wrapper .button,
  12. #editor .editor-styles-wrapper .button.has-focus,
  13. #editor .editor-styles-wrapper .button:focus,
  14. #editor .editor-styles-wrapper .button:hover,
  15. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
  16. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:focus,
  17. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:hover,
  18. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .has-focus.button,
  19. #editor .editor-styles-wrapper .wp-block-button__link,
  20. #editor .editor-styles-wrapper .wp-block-button__link.has-focus,
  21. #editor .editor-styles-wrapper .wp-block-button__link:focus,
  22. #editor .editor-styles-wrapper .wp-block-button__link:hover,
  23. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color,
  24. #editor .editor-styles-wrapper .wp-block-cover-image:not([class=*"background-color"]) .wp-block-cover-image-text,
  25. #editor .editor-styles-wrapper .wp-block-cover-image:not([class=*"background-color"]) .wp-block-cover-text,
  26. #editor .editor-styles-wrapper .wp-block-cover-image:not([class=*"background-color"]) .wp-block-cover__inner-container,
  27. #editor .editor-styles-wrapper .wp-block-cover:not([class=*"background-color"]) .wp-block-cover-image-text,
  28. #editor .editor-styles-wrapper .wp-block-cover:not([class=*"background-color"]) .wp-block-cover-text,
  29. #editor .editor-styles-wrapper .wp-block-cover:not([class=*"background-color"]) .wp-block-cover__inner-container', 'color' ),
  30. /**
  31. * Utility Classes
  32. */
  33. // Text-color
  34. array( '#editor .editor-styles-wrapper .has-primary-background-color[class],
  35. #editor .editor-styles-wrapper .has-secondary-background-color[class],
  36. #editor .editor-styles-wrapper .has-foreground-background-color[class],
  37. #editor .editor-styles-wrapper .has-foreground-dark-background-color[class],
  38. #editor .editor-styles-wrapper .has-foreground-light-background-color[class],
  39. #editor .editor-styles-wrapper .has-background-color[class]', 'color' ),
  40. // Background-color
  41. array( '#editor .editor-styles-wrapper .has-background-background-color[class]', 'background-color' ),
  42. // Text-color darkened
  43. array( '#editor .editor-styles-wrapper .has-background-dark-color[class]', 'color', '-1' ),
  44. // Background-color darkened
  45. array( '#editor .editor-styles-wrapper .has-background-dark-background-color[class]', 'background-color', '-1' ),
  46. // Text-color lightened
  47. array( '#editor .editor-styles-wrapper .has-background-light-color[class]', 'color', '+1' ),
  48. // Background-color lightened
  49. array( '#editor .editor-styles-wrapper .has-background-light-background-color[class]', 'background-color', '+1' ),
  50. /**
  51. * Grays
  52. * Uses a slightly darker color
  53. */
  54. // Color
  55. array( '#editor .editor-styles-wrapper .wp-block-separator.is-style-dots', 'color', '-1' ),
  56. // Border-color
  57. array( '#editor .editor-styles-wrapper .wp-block-code', 'border-color', '-1' ),
  58. // Border-top-color
  59. array( '#editor .editor-styles-wrapper .wp-block-pullquote', 'border-top-color', '-1' ),
  60. // Border-bottom-color
  61. array( '#editor .editor-styles-wrapper .wp-block-pullquote,
  62. #editor .editor-styles-wrapper .wp-block-separator', 'border-bottom-color', '-1' ),
  63. ), __( 'Background Color' ) );
  64. // Link Color
  65. // $config-global--color-primary-default
  66. add_editor_color_rule( 'link', '#CAAB57', array(
  67. // Background-color
  68. array( '#editor .editor-styles-wrapper .button,
  69. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
  70. #editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background),
  71. #editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'background-color' ),
  72. // Text-color
  73. array( '#editor .editor-styles-wrapper .is-style-outline .wp-block-button__link:not(.has-text-color),
  74. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline:not(.has-text-color),
  75. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
  76. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
  77. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:active,
  78. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:focus,
  79. #editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a:hover,
  80. #editor .editor-styles-wrapper .wp-block-button__link.is-style-outline,
  81. #editor .editor-styles-wrapper a', 'color' ),
  82. // Border color left
  83. array( '#editor .editor-styles-wrapper .wp-block-quote', 'border-left-color' ),
  84. // Border color right
  85. array( '#editor .editor-styles-wrapper .wp-block-quote[style*="text-align: right"],
  86. #editor .editor-styles-wrapper .wp-block-quote[style*="text-align:right"]', 'border-right-color' ),
  87. /**
  88. * Utility Classes
  89. */
  90. // Background-color
  91. array( '#editor .editor-styles-wrapper .has-primary-background-color[class]', 'background-color' ),
  92. // Text-color
  93. array( '#editor .editor-styles-wrapper .has-primary-color[class]', 'color' ),
  94. ), __( 'Link Color' ) );
  95. // Text Color
  96. // $config-global--color-foreground-default
  97. add_editor_color_rule( 'txt', '#f2f2f2', array(
  98. // Text-color
  99. array( '#editor .editor-styles-wrapper .editor-post-title__block .editor-post-title__input,
  100. #editor .editor-styles-wrapper .wp-block-pullquote,
  101. #editor .editor-styles-wrapper', 'color' ),
  102. // Background-color
  103. array( '#editor .editor-styles-wrapper table.is-style-stripes tbody tr:nth-child(odd),
  104. #editor .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'background-color' ),
  105. /**
  106. * Utility Classes
  107. */
  108. // Text-color
  109. array( '#editor .editor-styles-wrapper .has-foreground-color[class]', 'color' ),
  110. // Background-color
  111. array( '#editor .editor-styles-wrapper .has-foreground-background-color[class]', 'background-color' ),
  112. // Text-color darkened
  113. array( '#editor .editor-styles-wrapper .has-foreground-dark-color[class]', 'color', '-1' ),
  114. // Background-color darkened
  115. array( '#editor .editor-styles-wrapper .has-foreground-dark-background-color[class]', 'background-color', '-1' ),
  116. // Text-color brightened
  117. array( '#editor .editor-styles-wrapper .has-foreground-light-color[class]', 'color', '+2' ),
  118. // Background-color brightened
  119. array( '#editor .editor-styles-wrapper .has-foreground-light-background-color[class]', 'background-color', '+2' ),
  120. /**
  121. * Grays
  122. * Same as text color
  123. */
  124. // Text-color
  125. array( '#editor .editor-styles-wrapper .a8c-posts-list__item .a8c-posts-list-item__meta,
  126. #editor .editor-styles-wrapper .wp-block-image figcaption,
  127. #editor .editor-styles-wrapper .wp-block-latest-comments .wp-block-latest-comments__comment-date,
  128. #editor .editor-styles-wrapper .wp-block-latest-posts .wp-block-latest-posts__post-date,
  129. #editor .editor-styles-wrapper .wp-block-newspack-blocks-homepage-articles article .cat-links,
  130. #editor .editor-styles-wrapper .wp-block-newspack-blocks-homepage-articles article .entry-meta,
  131. #editor .editor-styles-wrapper .wp-block-pullquote .wp-block-pullquote__citation,
  132. #editor .editor-styles-wrapper .wp-block-pullquote cite,
  133. #editor .editor-styles-wrapper .wp-block-pullquote footer,
  134. #editor .editor-styles-wrapper .wp-block-quote .wp-block-quote__citation,
  135. #editor .editor-styles-wrapper .wp-block-quote cite,
  136. #editor .editor-styles-wrapper .wp-block-quote footer,
  137. #editor .editor-styles-wrapper .wp-block-quote.is-large .wp-block-quote__citation,
  138. #editor .editor-styles-wrapper .wp-block-quote.is-large cite,
  139. #editor .editor-styles-wrapper .wp-block-quote.is-large footer,
  140. #editor .editor-styles-wrapper .wp-block-quote.is-style-large .wp-block-quote__citation,
  141. #editor .editor-styles-wrapper .wp-block-quote.is-style-large cite,
  142. #editor .editor-styles-wrapper .wp-block-quote.is-style-large footer,
  143. #editor .editor-styles-wrapper .wp-block-video figcaption,
  144. #editor .editor-styles-wrapper figcaption', 'color' ),
  145. ), __( 'Text Color' ) );
  146. // Accent Color (Red)
  147. // $config-global--color-secondary-default
  148. add_editor_color_rule( 'fg1', '#EE4266', array(
  149. /**
  150. * Utility Classes
  151. */
  152. // Text-color
  153. array( '#editor .editor-styles-wrapper .has-secondary-color[class]', 'color' ),
  154. // Background-color
  155. array( '#editor .editor-styles-wrapper .has-secondary-background-color[class]', 'background-color' ),
  156. ), __( 'Secondary Color' ) );