style-editor.scss 16 KB

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