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