style-editor.scss 15 KB

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