style-editor.scss 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894
  1. /*!
  2. Twenty Nineteen Editor Styles
  3. */
  4. /** === Includes === */
  5. @import "sass/variables-site/variables-site";
  6. @import "sass/mixins/mixins-master";
  7. @import "sass/site/header/site-header";
  8. @import "sass/navigation/menu-main-navigation";
  9. @import "sass/typography/headings";
  10. /** === Editor Frame === */
  11. body {
  12. .wp-block[data-align="full"] {
  13. width: 100%;
  14. }
  15. @include media(mobile) {
  16. .wp-block[data-align="full"] {
  17. width: calc( 100% + 90px );
  18. max-width: calc( 100% + 90px );
  19. }
  20. }
  21. @include media(tablet) {
  22. .editor-writing-flow {
  23. max-width: 80%;
  24. margin: 0 10%;
  25. }
  26. .wp-block[data-align="wide"] {
  27. width: 100%;
  28. }
  29. .wp-block[data-align="full"] {
  30. position: relative;
  31. left: calc( -12.5% - 14px );
  32. width: calc( 125% + 116px );
  33. max-width: calc( 125% + 115px ); // Subtract 1px here to avoid the rounding errors that happen due to the usage of percentages.
  34. }
  35. .wp-block[data-align="right"] {
  36. max-width: 125%;
  37. }
  38. }
  39. }
  40. /** === Editor Block Toolbar Position === */
  41. // Since 2019 left-aligns wide and fullwide blocks, left align the toolbar too.
  42. .editor-block-list__block[data-align="wide"] .editor-block-contextual-toolbar .editor-block-toolbar.editor-block-toolbar,
  43. .editor-block-list__block[data-align="full"] .editor-block-contextual-toolbar .editor-block-toolbar.editor-block-toolbar {
  44. max-width: none;
  45. }
  46. /** === Content Width === */
  47. .wp-block {
  48. width: calc(100vw - (2 * #{$size__spacing-unit}));
  49. max-width: 100%;
  50. @include media(tablet) {
  51. width: calc(8 * (100vw / 12));
  52. }
  53. @include media(desktop) {
  54. width: calc(6 * (100vw / 12 ));
  55. }
  56. // Only the top level blocks need specific widths, therefore override for every nested block.
  57. .wp-block {
  58. width: 100%;
  59. }
  60. }
  61. /** === Base Typography === */
  62. body {
  63. font-size: $font__size_base;
  64. font-family: $font__body;
  65. line-height: $font__line-height-body;
  66. color: $color__text-main;
  67. }
  68. p {
  69. font-size: $font__size_base;
  70. &.has-small-font-size {
  71. font-size: $font__size-sm;
  72. }
  73. &.has-normal-font-size {
  74. font-size: $font__size-md;
  75. }
  76. &.has-large-font-size {
  77. font-size: $font__size-lg;
  78. }
  79. &.has-huge-font-size {
  80. font-size: $font__size-xl;
  81. }
  82. }
  83. h1,
  84. h2,
  85. h3,
  86. h4,
  87. h5,
  88. h6 {
  89. font-family: $font__heading;
  90. font-weight: 700;
  91. line-height: $font__line-height-heading;
  92. margin-top: 2rem;
  93. margin-bottom: 2rem;
  94. text-align: center;
  95. .editor-inner-blocks & {
  96. margin-top: 1.375rem;
  97. margin-bottom: 1.375rem;
  98. }
  99. }
  100. h1 {
  101. font-size: $font__size-lg;
  102. }
  103. h2 {
  104. font-size: $font__size-md;
  105. }
  106. h3 {
  107. font-size: $font__size_base;
  108. }
  109. h4 {
  110. font-size: $font__size-sm;
  111. }
  112. h5 {
  113. font-size: $font__size-xs;
  114. }
  115. h6 {
  116. font-size: $font__size-xxs;
  117. }
  118. a {
  119. @include link-transition;
  120. color: $color__link;
  121. *:visited {
  122. }
  123. &:hover,
  124. &:active {
  125. color: $color__link-hover;
  126. outline: 0;
  127. text-decoration: none;
  128. }
  129. &:focus {
  130. outline: 0;
  131. text-decoration: underline;
  132. }
  133. }
  134. // Use white text against these backgrounds by default.
  135. .has-primary-background-color,
  136. .has-secondary-background-color,
  137. .has-dark-gray-background-color,
  138. .has-light-gray-background-color {
  139. color: $color__background-body;
  140. p,
  141. h1,
  142. h2,
  143. h3,
  144. h4,
  145. h5,
  146. h6,
  147. a {
  148. color: $color__background-body;
  149. }
  150. }
  151. // Use dark gray text against this background by default.
  152. .has-white-background-color {
  153. color: $color__text-main;
  154. p,
  155. h1,
  156. h2,
  157. h3,
  158. h4,
  159. h5,
  160. h6,
  161. a {
  162. color: $color__text-main;
  163. }
  164. }
  165. figcaption,
  166. .gallery-caption {
  167. font-family: $font__heading;
  168. font-size: $font__size-xs;
  169. line-height: 1.6;
  170. color: $color__text-light;
  171. }
  172. /** === Post Title === */
  173. .editor-post-title__block {
  174. @include post-section-dash;
  175. font-size: $font__size_base;
  176. &:before {
  177. width: $font__size-xxl;
  178. margin-top: 0;
  179. margin-bottom: 0;
  180. margin-left: 1em;
  181. position: relative;
  182. top: 0.5em;
  183. }
  184. .editor-post-title__input {
  185. font-family: $font__heading;
  186. font-size: $font__size-lg;
  187. font-weight: 700;
  188. text-align: center;
  189. }
  190. }
  191. /** === Default Appender === */
  192. .editor-default-block-appender .editor-default-block-appender__content {
  193. font-family: $font__body;
  194. font-size: $font__size_base;
  195. }
  196. /** === Heading === */
  197. .wp-block-heading {
  198. strong {
  199. font-weight: bolder;
  200. }
  201. }
  202. /** === Paragraph === */
  203. .wp-block-paragraph {
  204. &.has-drop-cap:not(:focus)::first-letter {
  205. font-family: $font__heading;
  206. font-size: #{1.7 * $font__size-xxxl};
  207. line-height: 1;
  208. font-weight: normal;
  209. margin: 0 0.25em 0 0;
  210. }
  211. }
  212. /** === Table === */
  213. .wp-block-table {
  214. font-family: $font__heading;
  215. }
  216. /** === Cover === */
  217. .wp-block-cover,
  218. .wp-block-cover-image {
  219. min-height: 420px;
  220. .wp-block-cover__inner-container {
  221. padding-left: $size__spacing-unit;
  222. padding-right: $size__spacing-unit;
  223. strong {
  224. font-weight: bolder;
  225. }
  226. h1, h2, h3, h4, h5, h6 {
  227. text-align: inherit;
  228. &.has-text-align-left {
  229. text-align: left;
  230. }
  231. &.has-text-align-center {
  232. text-align: center;
  233. }
  234. &.has-text-align-right {
  235. text-align: right;
  236. }
  237. }
  238. h1 {
  239. font-size: $font__size-xl;
  240. @include media(tablet) {
  241. font-size: $font__size-xxl;
  242. }
  243. }
  244. h2 {
  245. font-size: $font__size-lg;
  246. max-width: 100%;
  247. padding: 0;
  248. @include media(tablet) {
  249. font-size: $font__size-xl;
  250. }
  251. }
  252. h3 {
  253. font-size: $font__size-md;
  254. @include media(tablet) {
  255. font-size: $font__size-lg;
  256. }
  257. }
  258. h4 {
  259. font-size: $font__size_base;
  260. @include media(tablet) {
  261. font-size: $font__size-md;
  262. }
  263. }
  264. h5 {
  265. font-size: $font__size-sm;
  266. @include media(tablet) {
  267. font-size: $font__size_base;
  268. }
  269. }
  270. h6 {
  271. font-size: $font__size-xs;
  272. @include media(tablet) {
  273. font-size: $font__size-sm;
  274. }
  275. }
  276. @include media(tablet) {
  277. margin-left: auto;
  278. margin-right: auto;
  279. padding: 0;
  280. }
  281. a {
  282. color: inherit;
  283. }
  284. }
  285. @include media(tablet) {
  286. min-height: 560px;
  287. padding-left: 10%;
  288. padding-right: 10%;
  289. }
  290. }
  291. .wp-block[data-type="core/cover"][data-align="left"],
  292. .wp-block[data-type="core/cover"][data-align="right"] {
  293. .wp-block-cover__inner-container {
  294. width: calc(4 * (100vw / 12));
  295. }
  296. .wp-block-cover {
  297. width: 100%;
  298. max-width: 100%;
  299. }
  300. @include media(tablet) {
  301. .wp-block-cover {
  302. padding: $size__spacing-unit;
  303. }
  304. }
  305. }
  306. .wp-block[data-type="core/cover"][data-align="wide"] {
  307. @include media(tablet) {
  308. .wp-block-cover__inner-container {
  309. max-width: calc(8 * (100vw / 12));
  310. }
  311. }
  312. @include media(desktop) {
  313. .wp-block-cover__inner-container {
  314. max-width: calc(6 * (100vw / 12));
  315. }
  316. }
  317. }
  318. .wp-block[data-type="core/cover"][data-align="full"] {
  319. @include media(tablet) {
  320. .wp-block-cover__inner-container {
  321. max-width: 100%;
  322. }
  323. .wp-block-cover {
  324. padding-left: calc(10% + 64px);
  325. padding-right: calc(10% + 64px);
  326. }
  327. }
  328. }
  329. /** === Gallery === */
  330. .wp-block-gallery {
  331. .blocks-gallery-image figcaption,
  332. .blocks-gallery-item figcaption,
  333. .gallery-item .gallery-caption {
  334. font-size: $font__size-xs;
  335. line-height: 1.6;
  336. }
  337. }
  338. /** === Button === */
  339. .wp-block-button {
  340. .wp-block-button__link {
  341. line-height: 1.8;
  342. font-family: $font__heading;
  343. font-size: $font__size-sm;
  344. font-weight: bold;
  345. }
  346. &:not(.is-style-outline) .wp-block-button__link {
  347. background: $color__background-button;
  348. }
  349. &:not(.is-style-squared) .wp-block-button__link {
  350. border-radius: 5px;
  351. }
  352. &.is-style-outline,
  353. &.is-style-outline:hover,
  354. &.is-style-outline:focus,
  355. &.is-style-outline:active {
  356. background: transparent;
  357. color: $color__background-button;
  358. .wp-block-button__link {
  359. background: transparent;
  360. &:not(.has-text-color) {
  361. color: $color__background-button;
  362. }
  363. }
  364. }
  365. }
  366. /** === Blockquote === */
  367. .wp-block-quote {
  368. &:not(.is-large):not(.is-style-large) {
  369. border-color: $color__link;
  370. border-width: 2px;
  371. }
  372. &.is-large,
  373. &.is-style-large {
  374. margin-top: $font__size-xxl;
  375. margin-bottom: $font__size-xxl;
  376. }
  377. &.is-large p,
  378. &.is-style-large p {
  379. font-size: $font__size-lg;
  380. line-height: 1.3;
  381. margin-bottom: 0.5em;
  382. margin-top: 0.5em;
  383. }
  384. cite,
  385. footer,
  386. .wp-block-quote__citation {
  387. font-family: $font__heading;
  388. font-size: $font__size-xs;
  389. line-height: 1.6;
  390. color: $color__text-light;
  391. }
  392. }
  393. /** === Pullquote === */
  394. .wp-block-pullquote {
  395. border-color: transparent;
  396. border-width: 2px;
  397. color: #000;
  398. blockquote {
  399. margin-top: calc(3 * #{ $size__spacing-unit});
  400. margin-bottom: calc(3.33 * #{ $size__spacing-unit});
  401. hyphens: auto;
  402. word-break: break-word;
  403. }
  404. &:not(.is-style-solid-color) .wp-block-pullquote__citation {
  405. color: $color__text-light;
  406. }
  407. &.is-style-solid-color {
  408. blockquote {
  409. width: calc(100% - (2 * #{ $size__spacing-unit}));
  410. max-width: calc( 100% - (2 * #{ $size__spacing-unit}));
  411. a,
  412. &.has-text-color p,
  413. &.has-text-color a {
  414. color: inherit;
  415. }
  416. &:not(.has-text-color) {
  417. color: $color__background-body;
  418. }
  419. @include media(tablet) {
  420. max-width: 80%;
  421. }
  422. }
  423. &:not(.has-background-color) {
  424. background-color: $color__link;
  425. }
  426. }
  427. }
  428. .wp-block[data-type="core/pullquote"],
  429. .wp-block[data-type="core/pullquote"][data-align="left"],
  430. .wp-block[data-type="core/pullquote"][data-align="right"] {
  431. blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before,
  432. blockquote > .editor-rich-text p,
  433. p {
  434. font-size: $font__size-lg;
  435. font-style: italic;
  436. line-height: 1.3;
  437. margin-bottom: 0.5em;
  438. margin-top: 0.5em;
  439. @include media(tablet) {
  440. font-size: $font__size-xl;
  441. }
  442. }
  443. .wp-block-pullquote__citation {
  444. font-family: $font__heading;
  445. font-size: $font__size-xs;
  446. line-height: 1.6;
  447. text-transform: none;
  448. }
  449. em {
  450. font-style: normal;
  451. }
  452. }
  453. .wp-block[data-type="core/pullquote"][data-align="left"],
  454. .wp-block[data-type="core/pullquote"][data-align="right"] {
  455. .editor-block-list__block-edit {
  456. width: calc(4 * (100vw / 12));
  457. max-width: 50%;
  458. .wp-block-pullquote:not(.is-style-solid-color) {
  459. padding: 0;
  460. }
  461. .wp-block-pullquote.is-style-solid-color {
  462. padding: 1em;
  463. }
  464. }
  465. blockquote > .block-library-pullquote__content .editor-rich-text__tinymce[data-is-empty="true"]::before,
  466. blockquote > .editor-rich-text p,
  467. p,
  468. .wp-block-pullquote__citation {
  469. text-align: left;
  470. }
  471. }
  472. .wp-block[data-type="core/pullquote"][data-align="full"] {
  473. @include media(tablet) {
  474. .wp-block-pullquote blockquote {
  475. max-width: calc(80% - 128px);
  476. }
  477. }
  478. }
  479. /** === File === */
  480. .wp-block-file {
  481. font-family: $font__heading;
  482. .wp-block-file__textlink {
  483. text-decoration: underline;
  484. color: $color__link;
  485. &:hover {
  486. color: $color__link-hover;
  487. text-decoration: none;
  488. }
  489. }
  490. .wp-block-file__button {
  491. display: table;
  492. line-height: 1.8;
  493. font-family: $font__ui;
  494. font-size: $font__size-sm;
  495. font-weight: bold;
  496. background-color: $color__link;
  497. border-radius: 5px;
  498. }
  499. .wp-block-file__button-richtext-wrapper {
  500. display: block;
  501. margin-top: calc(0.75 * #{$size__spacing-unit});
  502. margin-left: 0;
  503. }
  504. }
  505. /** === Verse === */
  506. .wp-block-verse,
  507. .wp-block-verse pre {
  508. padding: 0;
  509. }
  510. /** === Code === */
  511. .wp-block-code {
  512. border-radius: 0;
  513. }
  514. /** === Media & Text === */
  515. // Remove spacing between consecutive Media & Text blocks.
  516. [data-type="core/media-text"] {
  517. .wp-block-media-text {
  518. background: $color__background-screen;
  519. }
  520. .wp-block-heading {
  521. h1,
  522. h2,
  523. h3,
  524. h4,
  525. h5,
  526. h6 {
  527. text-align: inherit;
  528. margin-bottom: $size__spacing-unit;
  529. margin-top: $size__spacing-unit;
  530. }
  531. }
  532. & + [data-type="core/media-text"] {
  533. margin-top: -32px;
  534. }
  535. a {
  536. color: inherit;
  537. }
  538. }
  539. /** === Table === */
  540. .wp-block-table {
  541. td, th {
  542. border-color: $color__text-light;
  543. }
  544. }
  545. /** === Separator === */
  546. .wp-block-separator {
  547. margin-top: #{$size__spacing-unit * 3};
  548. margin-bottom: #{$size__spacing-unit * 3};
  549. &:not(.is-style-dots) {
  550. border-bottom: 2px solid #f1f1f1;
  551. }
  552. &:not(.is-style-wide):not(.is-style-dots) {
  553. width: 5em;
  554. }
  555. &.is-style-dots:before {
  556. color: $color__text-light;
  557. font-size: $font__size-lg;
  558. letter-spacing: calc(2 * #{$size__spacing-unit});
  559. padding-left: calc(2 * #{$size__spacing-unit});
  560. }
  561. }
  562. /** === Latest Posts, Archives, Categories === */
  563. ul.wp-block-archives,
  564. .wp-block-categories,
  565. .wp-block-latest-posts {
  566. padding: 0;
  567. list-style-type: none;
  568. ul {
  569. padding: 0;
  570. list-style-type: none;
  571. }
  572. li {
  573. color: $color__text-light;
  574. font-family: $font__heading;
  575. font-size: calc(#{$font__size_base} * #{$font__size-ratio});
  576. font-weight: bold;
  577. line-height: $font__line-height-heading;
  578. padding-bottom: ( .75 * $size__spacing-unit );
  579. &.menu-item-has-children,
  580. &:last-child {
  581. padding-bottom: 0;
  582. }
  583. a {
  584. text-decoration: none;
  585. }
  586. ul {
  587. padding-left: $size__spacing-unit;
  588. }
  589. }
  590. }
  591. .wp-block-categories {
  592. ul {
  593. padding-top: ( .75 * $size__spacing-unit );
  594. @include nestedSubMenuPadding();
  595. }
  596. li ul {
  597. list-style: none;
  598. padding-left: 0;
  599. margin-bottom: ( -.75 * $size__spacing-unit );
  600. }
  601. }
  602. /** === Latest Posts grid view === */
  603. .wp-block-latest-posts.is-grid {
  604. li {
  605. border-top: 2px solid $color__border;
  606. padding-top: (1 * $size__spacing-unit);
  607. margin-bottom: (2 * $size__spacing-unit);
  608. a {
  609. &:after {
  610. content: '';
  611. }
  612. }
  613. &:last-child {
  614. margin-bottom: auto;
  615. a:after {
  616. content: '';
  617. }
  618. }
  619. }
  620. }
  621. /** === Latest Comments === */
  622. .wp-block-latest-comments {
  623. .wp-block-latest-comments__comment-meta {
  624. font-family: $font__heading;
  625. font-weight: bold;
  626. .wp-block-latest-comments__comment-date {
  627. font-weight: normal;
  628. }
  629. }
  630. .wp-block-latest-comments__comment,
  631. .wp-block-latest-comments__comment-date,
  632. .wp-block-latest-comments__comment-excerpt p {
  633. font-size: inherit;
  634. }
  635. .wp-block-latest-comments__comment-date {
  636. font-size: $font__size-xs;
  637. }
  638. }
  639. /** === Site Title Block === */
  640. .wp-block-a8c-site-title {
  641. text-align: center;
  642. }
  643. /** === Site Description Block === */
  644. .wp-block-a8c-site-description {
  645. text-align: center;
  646. margin: 0;
  647. }
  648. /** === Classic Editor === */
  649. /* Properly center-align captions in the classic-editor block */
  650. .wp-caption {
  651. dd {
  652. color: $color__text-light;
  653. font-size: $font__size-xs;
  654. font-family: $font__heading;
  655. line-height: $font__line-height-pre;
  656. margin: 0;
  657. padding: ( $size__spacing-unit * .5 );
  658. text-align: left;
  659. text-align: center;
  660. -webkit-margin-start: 0px;
  661. margin-inline-start: 0px;
  662. }
  663. }
  664. .wp-block-freeform {
  665. /* Add style for galleries in classic-editor block */
  666. blockquote {
  667. border-left: 2px solid $color__link;
  668. cite {
  669. font-family: $font__heading;
  670. font-size: $font__size-xs;
  671. font-style: normal;
  672. line-height: 1.6;
  673. color: $color__text-light;
  674. }
  675. }
  676. }
  677. /* Make sure our non-latin font overrides don't overwrite the iconfont used in the classic editor toolbar */
  678. .wp-block[data-type="core/freeform"] .mce-btn i {
  679. font-family: dashicons !important;
  680. }
  681. /** === Mailchimp Block - Temp Fix === */
  682. .wp-block-jetpack-mailchimp {
  683. p {
  684. font-size: $font__size-xs;
  685. }
  686. }
  687. /** === Business Hours Block - Temp Fix === */
  688. .wp-block-jetpack-business-hours {
  689. dt,
  690. dd {
  691. float: left;
  692. }
  693. dt {
  694. clear: both;
  695. font-weight: bold;
  696. margin-right: ( $size__spacing-unit * .5 );
  697. }
  698. dd {
  699. margin: 0;
  700. }
  701. }