_editor.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /**
  2. * Editor Post Title
  3. * - Needs a special styles
  4. */
  5. .editor-post-title__block .editor-post-title__input {
  6. color: #{map-deep-get($config-global, "color", "foreground", "default")};
  7. @include font-family( map-deep-get($config-heading, "font", "family") );
  8. font-weight: #{map-deep-get($config-heading, "font", "weight")};
  9. font-size: (strip-unit(map-deep-get($config-heading, "font", "size", "h2")) + 0);
  10. letter-spacing: #{map-deep-get($config-heading, "font", "letter-spacing", "h2")};
  11. line-height: #{map-deep-get($config-heading, "font", "line-height", "h2")};
  12. }
  13. // Gutenberg text color options
  14. // .has-text-color {}
  15. .wp-block .has-primary-color,
  16. .has-primary-color {
  17. color: #{map-deep-get($config-global, "color", "primary", "default")};
  18. }
  19. .wp-block .has-secondary-color,
  20. .has-secondary-color {
  21. color: #{map-deep-get($config-global, "color", "secondary", "default")};
  22. }
  23. .wp-block .has-foreground-color,
  24. .has-foreground-color {
  25. color: #{map-deep-get($config-global, "color", "foreground", "default")};
  26. }
  27. .wp-block .has-foreground-light-color,
  28. .has-foreground-light-color {
  29. color: #{map-deep-get($config-global, "color", "foreground", "light")};
  30. }
  31. .wp-block .has-foreground-dark-color,
  32. .has-foreground-dark-color {
  33. color: #{map-deep-get($config-global, "color", "foreground", "dark")};
  34. }
  35. .wp-block .has-background-light-color,
  36. .has-background-light-color {
  37. color: #{map-deep-get($config-global, "color", "background", "light")};
  38. }
  39. .wp-block .has-background-dark-color,
  40. .has-background-dark-color {
  41. color: #{map-deep-get($config-global, "color", "background", "dark")};
  42. }
  43. .wp-block .has-background-color,
  44. .has-background-color {
  45. color: #{map-deep-get($config-global, "color", "background", "default")};
  46. }
  47. @if map-has-key(map-deep-get($config-global, "color"), "tertiary") {
  48. .wp-block .has-tertiary-color,
  49. .has-tertiary-color {
  50. color: #{map-deep-get($config-global, "color", "tertiary", "default")};
  51. }
  52. }
  53. // Gutenberg background-color options
  54. .has-background {
  55. p:not(.has-text-color),
  56. h1:not(.has-text-color),
  57. h2:not(.has-text-color),
  58. h3:not(.has-text-color),
  59. h4:not(.has-text-color),
  60. h5:not(.has-text-color),
  61. h6:not(.has-text-color) {
  62. color: currentColor;
  63. }
  64. }
  65. .has-primary-background-color,
  66. .has-primary-background-color.has-background-dim {
  67. background-color: #{map-deep-get($config-global, "color", "primary", "default")};
  68. color: #{map-deep-get($config-global, "color", "background", "default")};
  69. }
  70. .has-primary-background-color:not(.has-text-color),
  71. .has-primary-background-color.has-background-dim:not(.has-text-color) {
  72. color: #{map-deep-get($config-global, "color", "background", "default")};
  73. }
  74. .has-secondary-background-color,
  75. .has-secondary-background-color.has-background-dim {
  76. background-color: #{map-deep-get($config-global, "color", "secondary", "default")};
  77. }
  78. .has-secondary-background-color:not(.has-text-color),
  79. .has-secondary-background-color.has-background-dim:not(.has-text-color) {
  80. color: #{map-deep-get($config-global, "color", "background", "default")};
  81. }
  82. .has-background-dim,
  83. .has-foreground-background-color,
  84. .has-foreground-background-color.has-background-dim {
  85. background-color: #{map-deep-get($config-global, "color", "foreground", "default")};
  86. }
  87. .has-background-dim,
  88. .has-foreground-background-color,
  89. .has-foreground-background-color.has-background-dim {
  90. color: #{map-deep-get($config-global, "color", "background", "default")};
  91. }
  92. .has-foreground-light-background-color,
  93. .has-foreground-light-background-color.has-background-dim {
  94. background-color: #{map-deep-get($config-global, "color", "foreground", "light")};
  95. }
  96. .has-foreground-light-background-color:not(.has-text-color),
  97. .has-foreground-light-background-color.has-background-dim:not(.has-text-color) {
  98. color: #{map-deep-get($config-global, "color", "background", "default")};
  99. }
  100. .has-foreground-dark-background-color,
  101. .has-foreground-dark-background-color.has-background-dim {
  102. background-color: #{map-deep-get($config-global, "color", "foreground", "dark")};
  103. }
  104. .has-foreground-dark-background-color:not(.has-text-color),
  105. .has-foreground-dark-background-color.has-background-dim:not(.has-text-color) {
  106. color: #{map-deep-get($config-global, "color", "background", "default")};
  107. }
  108. .has-background-light-background-color,
  109. .has-background-light-background-color.has-background-dim {
  110. background-color: #{map-deep-get($config-global, "color", "background", "light")};
  111. }
  112. .has-background-light-background-color:not(.has-text-color),
  113. .has-background-light-background-color.has-background-dim:not(.has-text-color) {
  114. color: #{map-deep-get($config-global, "color", "foreground", "default")};
  115. }
  116. .has-background-dark-background-color,
  117. .has-background-dark-background-color.has-background-dim {
  118. background-color: #{map-deep-get($config-global, "color", "background", "dark")};
  119. }
  120. .has-background-dark-background-color:not(.has-text-color),
  121. .has-background-dark-background-color.has-background-dim:not(.has-text-color) {
  122. color: #{map-deep-get($config-global, "color", "foreground", "default")};
  123. }
  124. .has-background-background-color,
  125. .has-background-background-color.has-background-dim {
  126. background-color: #{map-deep-get($config-global, "color", "background", "default")};
  127. color: #{map-deep-get($config-global, "color", "foreground", "default")};
  128. }
  129. .has-background-background-color:not(.has-text-color),
  130. .has-background-background-color.has-background-dim:not(.has-text-color) {
  131. color: #{map-deep-get($config-global, "color", "foreground", "default")};
  132. }
  133. @if map-has-key(map-deep-get($config-global, "color"), "tertiary") {
  134. .has-tertiary-background-color,
  135. .has-tertiary-background-color.has-background-dim {
  136. background-color: #{map-deep-get($config-global, "color", "tertiary", "default")};
  137. }
  138. .has-tertiary-background-color:not(.has-text-color),
  139. .has-tertiary-background-color.has-background-dim:not(.has-text-color) {
  140. color: #{map-deep-get($config-global, "color", "foreground", "default")};
  141. }
  142. }
  143. // Gutenberg Font-size utility classes
  144. .is-small-text,
  145. .has-small-font-size {
  146. font-size: (strip-unit(map-deep-get($config-global, "font", "size", "sm")) + 0);
  147. }
  148. .is-regular-text,
  149. .has-regular-font-size,
  150. .has-normal-font-size,
  151. .has-medium-font-size {
  152. font-size: (strip-unit(map-deep-get($config-global, "font", "size", "md")) + 0);
  153. }
  154. .is-large-text,
  155. .has-large-font-size {
  156. font-size: (strip-unit(map-deep-get($config-global, "font", "size", "lg")) + 0);
  157. line-height: #{map-deep-get($config-global, "font", "line-height", "heading")};
  158. }
  159. .is-larger-text,
  160. .has-larger-font-size,
  161. .has-huge-font-size {
  162. font-size: (strip-unit(map-deep-get($config-global, "font", "size", "xl")) + 0);
  163. line-height: #{map-deep-get($config-global, "font", "line-height", "heading")};
  164. }
  165. // Drop cap
  166. .has-drop-cap:not(:focus)::first-letter {
  167. @include font-family( map-deep-get($config-heading, "font", "family") );
  168. font-size: calc(2 * #{strip-unit(map-deep-get($config-heading, "font", "size", "h1")) + 0em});
  169. font-weight: #{map-deep-get($config-heading, "font", "weight")};
  170. }
  171. /**
  172. * Spacing Overrides
  173. */
  174. [data-block] {
  175. margin-top: #{ 0.666 * map-deep-get($config-global, "spacing", "vertical") };
  176. margin-bottom: #{ 0.666 * map-deep-get($config-global, "spacing", "vertical") };
  177. @include media(mobile) {
  178. margin-top: #{map-deep-get($config-global, "spacing", "vertical")};
  179. margin-bottom: #{map-deep-get($config-global, "spacing", "vertical")};
  180. }
  181. }
  182. @import "spacing-overrides";