theme.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. /* Text selection text color */
  2. ::selection {
  3. color: var(--wp--custom--color--background);
  4. background-color: var(--wp--custom--color--foreground);
  5. }
  6. /* Post title when featured image is present */
  7. h1.wp-block-post-title {
  8. body:not(.has-featured-image) & {
  9. border-bottom:
  10. var(--wp--custom--form--border--width)
  11. var(--wp--custom--form--border--style) var(--wp--preset--color--primary);
  12. padding-bottom: calc(var(--wp--custom--gap--vertical) * 3);
  13. }
  14. }
  15. /* Separator width */
  16. .wp-block-separator {
  17. /* https://github.com/WordPress/gutenberg/pull/38428 */
  18. opacity: 1;
  19. &.is-style-wide {
  20. /* We can remove after https://github.com/WordPress/gutenberg/pull/38635 gets deployed */
  21. border-width: 0 0 3px 0;
  22. }
  23. &.has-background {
  24. height: 3px;
  25. }
  26. }
  27. /* Links and underlines */
  28. @mixin text-decoration() {
  29. text-decoration-thickness: 0.07em;
  30. text-underline-offset: 0.46ex;
  31. }
  32. a {
  33. @include text-decoration;
  34. }
  35. .wp-block-post-content p a:not(.wp-block-post-excerpt__more-link) {
  36. text-decoration-line: underline;
  37. &:hover {
  38. text-decoration: none;
  39. background-color: var(--wp--custom--color--primary);
  40. color: var(--wp--custom--color--background);
  41. }
  42. }
  43. .wp-block-post-comments .comment-meta > a,
  44. .wp-block-post-comments .comment-body > p > a,
  45. .wp-block-post-comments .comment-edit-link,
  46. .post-meta a {
  47. text-decoration-line: underline;
  48. &:hover {
  49. text-decoration-line: none;
  50. }
  51. }
  52. //Exceptions for the general underline rule
  53. h1 a,
  54. h2 a,
  55. h3 a,
  56. h4 a,
  57. h5 a,
  58. h6 a,
  59. .wp-block-site-title a,
  60. .wp-block-post-title a {
  61. text-underline-offset: 0.1ex;
  62. }
  63. .wp-block-site-title a,
  64. .wp-block-post-title a,
  65. .wp-block-query-pagination a,
  66. .wp-block-navigation a {
  67. text-decoration-line: none;
  68. &:hover {
  69. text-decoration-line: underline;
  70. }
  71. }
  72. // Select the focus states of all non-wpadmin and screen reader links
  73. .wp-block-search__button,
  74. a:not(.ab-item):not(.screen-reader-shortcut) {
  75. &:active,
  76. &:focus {
  77. outline: 1px dotted var(--wp--custom--color--primary);
  78. outline-offset: 0.1em;
  79. text-decoration: none;
  80. }
  81. .wp-block-navigation & {
  82. &:active,
  83. &:focus {
  84. outline-color: currentcolor;
  85. }
  86. }
  87. }
  88. .archive,
  89. .blog,
  90. .home {
  91. .wp-block-post-date {
  92. text-decoration: underline;
  93. @include text-decoration;
  94. }
  95. }
  96. .wp-block-query-pagination {
  97. .wp-block-query-pagination-numbers {
  98. .current {
  99. @include text-decoration;
  100. }
  101. }
  102. }
  103. .wp-block-post-excerpt__more-link {
  104. font-weight: 500;
  105. }
  106. /*
  107. * Search and File Block button styles.
  108. * Necessary until the following issues are resolved in Gutenberg:
  109. * https://github.com/WordPress/gutenberg/issues/36444
  110. * https://github.com/WordPress/gutenberg/issues/27760
  111. */
  112. .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper {
  113. border-style: var(--wp--custom--button--border--style);
  114. border-width: var(--wp--custom--button--border--width);
  115. border-color: var(--wp--custom--color--foreground);
  116. }
  117. .wp-block-search__input {
  118. background-color: transparent;
  119. border: var(--wp--custom--form--border--width) var(--wp--custom--form--border--style) var(--wp--custom--form--border--color);
  120. }
  121. .wp-block-search__button,
  122. .wp-block-file .wp-block-file__button {
  123. border-width: 0;
  124. border-radius: 0;
  125. background-color: var(--wp--custom--color--foreground);
  126. color: var(--wp--custom--color--background);
  127. font-size: var(--wp--preset--font-size--normal);
  128. font-weight: var(--wp--custom--button--typography--font-weight);
  129. padding: calc(0.667em + 2px) calc(1.333em + 2px);
  130. line-height: var(--wp--custom--button--typography--line-height);
  131. }
  132. .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button {
  133. border-width: 0;
  134. padding-top: calc(var(--wp--custom--button--spacing--padding--top) + var(--wp--custom--button--border--width));
  135. padding-bottom: calc(var(--wp--custom--button--spacing--padding--bottom) + var(--wp--custom--button--border--width));
  136. padding-left: calc(var(--wp--custom--button--spacing--padding--left) + var(--wp--custom--button--border--width));
  137. padding-right: calc(var(--wp--custom--button--spacing--padding--right) + var(--wp--custom--button--border--width));
  138. }
  139. /*
  140. * Button hover styles.
  141. * Necessary until the following issue is resolved in Gutenberg:
  142. * https://github.com/WordPress/gutenberg/issues/27075
  143. */
  144. .wp-block-search__button:hover,
  145. .wp-block-file .wp-block-file__button:hover,
  146. .wp-block-button__link:hover {
  147. opacity: 0.9;
  148. }
  149. /* Comments */
  150. .wp-block-post-comments input[type="submit"] {
  151. font-family: var(--wp--preset--font-family--red-hat-display);
  152. color: var(--wp--custom--color--background);
  153. }
  154. .wp-block-post-comments textarea,
  155. .wp-block-post-comments input:not([type="submit"]) {
  156. background-color: var(--wp--custom--color--background);
  157. color: var(--wp--custom--color--foreground);
  158. border-style: var(--wp--custom--button--border--style);
  159. border-width: var(--wp--custom--button--border--width);
  160. border-color: var(--wp--custom--color--foreground);
  161. }
  162. /*
  163. * Alignment styles, borrowed from Twenty Twenty-Two.
  164. * These rules are temporary, and should not be relied on or
  165. * modified too heavily by themes or plugins that build on
  166. * Twenty Twenty-Two. These are meant to be a precursor to
  167. * a global solution provided by the Block Editor.
  168. *
  169. * Relevant issues:
  170. * https://github.com/WordPress/gutenberg/issues/35607
  171. * https://github.com/WordPress/gutenberg/issues/35884
  172. */
  173. .wp-site-blocks,
  174. body > .is-root-container,
  175. .edit-post-visual-editor__post-title-wrapper,
  176. .wp-block-group.alignfull,
  177. .wp-block-group.has-background,
  178. .wp-block-cover.alignfull,
  179. .is-root-container .wp-block[data-align="full"] > .wp-block-group,
  180. .is-root-container .wp-block[data-align="full"] > .wp-block-cover {
  181. padding-left: var(--wp--custom--spacing--outer);
  182. padding-right: var(--wp--custom--spacing--outer);
  183. }
  184. .wp-site-blocks .alignfull,
  185. .wp-site-blocks > .wp-block-group.has-background,
  186. .wp-site-blocks > .wp-block-cover,
  187. .wp-site-blocks > .wp-block-template-part > .wp-block-group.has-background,
  188. .wp-site-blocks > .wp-block-template-part > .wp-block-cover,
  189. body > .is-root-container > .wp-block-cover,
  190. body > .is-root-container > .wp-block-template-part > .wp-block-group.has-background,
  191. body > .is-root-container > .wp-block-template-part > .wp-block-cover,
  192. .is-root-container .wp-block[data-align="full"] {
  193. margin-left: calc(-1 * var(--wp--custom--spacing--outer)) !important;
  194. margin-right: calc(-1 * var(--wp--custom--spacing--outer)) !important;
  195. max-width: unset;
  196. width: unset;
  197. }
  198. /* Blocks inside columns don't have negative margins. */
  199. .wp-site-blocks .wp-block-columns .wp-block-column .alignfull,
  200. .is-root-container .wp-block-columns .wp-block-column .wp-block[data-align="full"],
  201. /* We also want to avoid stacking negative margins. */
  202. .wp-site-blocks .alignfull:not(.wp-block-group) .alignfull,
  203. .is-root-container .wp-block[data-align="full"] > *:not(.wp-block-group) .wp-block[data-align="full"] {
  204. margin-left: auto !important;
  205. margin-right: auto !important;
  206. width: inherit;
  207. }
  208. /*
  209. * Responsive menu container padding.
  210. * This ensures the responsive container inherits the same
  211. * spacing defined above. This behavior may be built into
  212. * the Block Editor in the future.
  213. */
  214. .wp-block-navigation__responsive-container.is-menu-open {
  215. padding-top: var(--wp--custom--spacing--outer);
  216. padding-bottom: var(--wp--custom--spacing--large);
  217. padding-right: var(--wp--custom--spacing--outer);
  218. padding-left: var(--wp--custom--spacing--outer);
  219. }