page-editor.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  1. @use 'sass:color';
  2. @use 'sass:map';
  3. @use 'sass:math';
  4. @import '../../../../../../client/scss/settings';
  5. @import '../../../../../../client/scss/tools';
  6. .page-editor {
  7. .content-wrapper {
  8. margin-bottom: 10em;
  9. }
  10. .breadcrumb {
  11. margin: -1.2em 0 2em; // sass linter complains about $desktop-nice-padding here because of unit mismatch
  12. padding-left: calc(#{$desktop-nice-padding} - 2em);
  13. @include media-breakpoint-up(sm) {
  14. margin-top: -1.8em;
  15. margin-left: -$desktop-nice-padding;
  16. margin-right: -$desktop-nice-padding;
  17. }
  18. }
  19. .modal .breadcrumb {
  20. margin: 0;
  21. padding-left: 0.5em;
  22. background-color: transparent;
  23. .breadcrumb-item {
  24. padding-left: 0;
  25. padding-right: 0;
  26. }
  27. a {
  28. color: $color-grey-2;
  29. padding-left: 0.5em;
  30. padding-right: 0.5em;
  31. &:hover {
  32. color: $color-white;
  33. }
  34. }
  35. li:hover {
  36. background-color: transparent;
  37. }
  38. .home_icon {
  39. margin-left: 0;
  40. }
  41. div.c-dropdown__button.u-btn-current {
  42. color: $color-grey-2;
  43. &:hover {
  44. background-color: transparent;
  45. cursor: default;
  46. }
  47. }
  48. .status-tag {
  49. margin-bottom: 0;
  50. }
  51. .u-link {
  52. color: $color-white;
  53. }
  54. }
  55. h1 {
  56. font-size: 1.915em; // approximately 26px
  57. &.header-title {
  58. text-transform: initial;
  59. }
  60. }
  61. .header-title {
  62. padding-left: 0;
  63. }
  64. .modal-body .header-title h1 {
  65. font-size: 1.5em;
  66. }
  67. .header-meta {
  68. list-style: none;
  69. margin-top: 0;
  70. margin-bottom: 0;
  71. padding: 0;
  72. li {
  73. border: 0;
  74. float: left;
  75. height: 1.5em;
  76. line-height: 2em;
  77. margin: 1em 0.75em 1.5em 0;
  78. .icon {
  79. @include svg-icon(1.25em, text-bottom);
  80. margin-right: 0.2em;
  81. }
  82. .icon-warning {
  83. @include svg-icon();
  84. }
  85. &:first-child .button {
  86. margin-left: -0.8em;
  87. }
  88. .avatar {
  89. margin-left: 0;
  90. }
  91. }
  92. .button {
  93. font-size: 1em;
  94. font-weight: 600;
  95. margin-top: -0.25em; // Account for the button border
  96. overflow: initial;
  97. height: 2.5em;
  98. line-height: 2.5em;
  99. }
  100. .action-workflow-status {
  101. font-weight: 600;
  102. span {
  103. font-weight: 300;
  104. }
  105. }
  106. .human-readable-date {
  107. display: inline;
  108. }
  109. &--status {
  110. padding-right: 0.8em;
  111. }
  112. &--type {
  113. padding: 0 0.8em;
  114. }
  115. }
  116. }
  117. // An object is the basic wrapper around any field or group of fields in the editor interface
  118. .object {
  119. @include nice-padding();
  120. position: relative;
  121. &:first-child {
  122. border: 0;
  123. }
  124. &.focused {
  125. border-color: $color-input-focus-border;
  126. }
  127. fieldset,
  128. .field-row {
  129. padding-top: $object-title-height + 12px;
  130. }
  131. fieldset {
  132. padding-left: 0;
  133. padding-right: 0;
  134. .field-row {
  135. padding-top: 0;
  136. }
  137. }
  138. .object-help {
  139. display: block;
  140. position: relative;
  141. z-index: 1;
  142. top: $object-title-height;
  143. margin-top: 0;
  144. margin-bottom: -1em;
  145. padding: 1em math.div($grid-gutter-width, 2) 1em 3em;
  146. opacity: 1;
  147. .icon-help {
  148. margin-left: -1.75em;
  149. }
  150. }
  151. &:hover .object-help {
  152. opacity: 1;
  153. }
  154. > .title-wrapper {
  155. box-sizing: border-box;
  156. height: $object-title-height;
  157. -webkit-font-smoothing: auto;
  158. background: $color-salmon-light;
  159. color: #200200;
  160. text-transform: uppercase;
  161. padding: 0.9em 0 0.9em 5em;
  162. font-size: 0.95em;
  163. margin: 0;
  164. line-height: 1.5em;
  165. font-weight: normal;
  166. position: absolute;
  167. top: 0;
  168. left: 0;
  169. right: 0;
  170. z-index: 1;
  171. overflow: hidden;
  172. label {
  173. display: inline;
  174. text-transform: inherit;
  175. font-weight: inherit;
  176. float: none;
  177. width: auto;
  178. color: inherit;
  179. font-size: inherit;
  180. }
  181. &:before {
  182. @include font-smoothing;
  183. text-shadow: none;
  184. font-family: $font-wagtail-icons;
  185. text-transform: none;
  186. content: map.get($icons, 'arrow-down');
  187. text-align: center;
  188. display: block;
  189. position: absolute;
  190. z-index: 2;
  191. font-size: 2em;
  192. top: 0;
  193. line-height: 1.8em;
  194. left: 0;
  195. width: $desktop-nice-padding;
  196. color: $color-white;
  197. padding: 0;
  198. margin: 0;
  199. background-color: $color-salmon;
  200. }
  201. }
  202. &.required {
  203. > .title-wrapper label:after {
  204. content: '*';
  205. color: $color-red;
  206. font-weight: bold;
  207. display: inline-block;
  208. margin-left: 0.5em;
  209. line-height: 1em;
  210. font-size: 13px;
  211. }
  212. }
  213. // Special full-width, one-off fields i.e a single text or textarea input
  214. &.full {
  215. fieldset {
  216. display: block;
  217. float: none;
  218. }
  219. li {
  220. padding: 0;
  221. }
  222. .error-message {
  223. @include nice-padding();
  224. padding-bottom: 2em;
  225. }
  226. .error,
  227. .error input:not([type='submit']),
  228. .error textarea {
  229. background-color: $color-input-error-bg;
  230. }
  231. }
  232. // cursory styling for streamfield. Main styling in client/src/components/StreamField/StreamField.scss
  233. &.stream-field {
  234. padding-left: 20px;
  235. padding-right: 20px;
  236. .object-layout_big-part {
  237. max-width: 100%;
  238. }
  239. fieldset {
  240. padding-bottom: 0;
  241. max-width: unset;
  242. // Workaround to make sure blocks do not overflow horizontally.
  243. min-width: 0;
  244. }
  245. .block_field > .field-content {
  246. width: 100%;
  247. }
  248. }
  249. // special panel for the publishing fields, requires a bit more pizzazz
  250. &.publishing {
  251. > .title-wrapper:before {
  252. content: map.get($icons, 'date');
  253. font-size: 1.8rem;
  254. line-height: 1.4em;
  255. width: 1.4em;
  256. }
  257. }
  258. &.privacy {
  259. > .title-wrapper:before {
  260. content: map.get($icons, 'view');
  261. }
  262. }
  263. .multiple {
  264. padding: 4.5em 0 0;
  265. fieldset {
  266. padding-top: 0;
  267. padding-bottom: 0;
  268. }
  269. }
  270. .fields {
  271. max-width: 100%;
  272. }
  273. // removes top padding from multiples used within another panel
  274. .fields .multiple {
  275. padding-top: 0;
  276. }
  277. .add {
  278. padding-top: 1em;
  279. }
  280. &.empty {
  281. border-bottom: 1px solid $color-white;
  282. > h3 {
  283. margin: 0;
  284. border-bottom: 1px solid $color-white;
  285. }
  286. // wrapper around add button for multiple objects. Default version is wordless plus button for contracted groups of fields
  287. .add {
  288. @include transition(background-color 0.2s ease);
  289. position: relative;
  290. z-index: 2;
  291. top: 0;
  292. left: 0;
  293. width: 3.3em;
  294. padding: 0;
  295. margin: 0 0 0 -20px;
  296. cursor: pointer;
  297. .button {
  298. border-radius: 0;
  299. overflow: visible;
  300. background-color: $color-salmon-light;
  301. font-size: 0; // helps fake the effect of t.ext-replace class, which can't be used here.
  302. width: 2em;
  303. // stylelint-disable max-nesting-depth
  304. &:before {
  305. position: relative;
  306. padding: 0;
  307. line-height: 1.8em; // specific height required as parent 'a' has no height
  308. font-size: 1.4rem;
  309. width: 1.8em;
  310. background-color: $color-salmon;
  311. }
  312. &:hover:before {
  313. background-color: color.adjust($color-salmon, $lightness: -5%);
  314. }
  315. }
  316. }
  317. .multiple {
  318. padding: 0;
  319. }
  320. }
  321. &.collapsible {
  322. // li.collapsed gets its height from the fieldset only, which is now hidden
  323. // and h2 has position: absolute which doesn't add to it either, so it would be 0 without this
  324. min-height: 41px;
  325. .title-wrapper {
  326. &:before {
  327. content: map.get($icons, 'collapse-up');
  328. cursor: pointer;
  329. }
  330. }
  331. &.collapsed {
  332. .title-wrapper {
  333. &:before {
  334. content: map.get($icons, 'collapse-down');
  335. }
  336. }
  337. }
  338. }
  339. }
  340. // Custom styles that make some fields look more important
  341. .full {
  342. input:not([type='submit']),
  343. textarea {
  344. @include nice-padding;
  345. border-radius: 0;
  346. padding-top: 1.5em;
  347. padding-bottom: 1.5em;
  348. font-size: 1.2em;
  349. line-height: 1.6em;
  350. }
  351. }
  352. .title {
  353. input:not([type='submit']),
  354. textarea {
  355. font-size: 2em;
  356. font-family: $font-sans;
  357. }
  358. }
  359. // Footer control bar for performing actions on the page
  360. footer .actions {
  361. .button {
  362. font-weight: 600;
  363. text-overflow: ellipsis;
  364. }
  365. }
  366. footer .preview {
  367. button,
  368. .button {
  369. padding: 0 1em;
  370. .icon {
  371. margin-right: 0.5em;
  372. }
  373. @include media-breakpoint-down(xs) {
  374. width: 100%;
  375. margin-top: 2px;
  376. margin-bottom: 2px;
  377. height: 3em;
  378. }
  379. background-color: color.adjust($color-grey-2, $lightness: 10%);
  380. border-color: color.adjust($color-grey-2, $lightness: 10%);
  381. &:hover {
  382. background-color: $color-grey-2;
  383. border-color: $color-grey-2;
  384. }
  385. }
  386. .dropdown {
  387. input[type='button'],
  388. input[type='submit'],
  389. button,
  390. .button {
  391. background-color: color.adjust($color-grey-2, $lightness: 10%);
  392. border-color: color.adjust($color-grey-2, $lightness: 10%);
  393. &:hover {
  394. background-color: $color-grey-2;
  395. border-color: $color-grey-2;
  396. }
  397. }
  398. ul,
  399. .dropdown-toggle {
  400. background-color: color.adjust($color-grey-2, $lightness: 10%);
  401. }
  402. .dropdown-toggle:hover,
  403. &.open > .button + .dropdown-toggle {
  404. background-color: $color-grey-2;
  405. }
  406. }
  407. }
  408. @include media-breakpoint-up(sm) {
  409. .object {
  410. fieldset {
  411. // Override column mixin for column items.
  412. display: block;
  413. // Override column mixin for column items.
  414. float: none;
  415. max-width: 1024px;
  416. padding-left: 0;
  417. padding-right: 0;
  418. fieldset {
  419. width: 100%;
  420. }
  421. }
  422. .object-layout {
  423. display: flex;
  424. flex-flow: row-reverse wrap;
  425. &_small-part {
  426. flex: 1 0 0;
  427. }
  428. &_big-part {
  429. flex: 5 0 0;
  430. }
  431. }
  432. .object-help {
  433. padding-bottom: 40px;
  434. margin-left: 10px;
  435. margin-bottom: 0;
  436. opacity: 0;
  437. }
  438. &.stream-field {
  439. .object-help {
  440. padding-left: 6.4em;
  441. }
  442. }
  443. &.full {
  444. fieldset {
  445. // Override column mixin for column items.
  446. display: block;
  447. // Override column mixin for column items.
  448. float: none;
  449. margin-left: -51px;
  450. padding: 0;
  451. padding-top: $object-title-height;
  452. }
  453. input:not([type='submit']),
  454. textarea {
  455. border-width: 0 1px;
  456. }
  457. .field {
  458. padding: 0;
  459. }
  460. .field-content {
  461. display: block;
  462. float: none;
  463. width: auto;
  464. padding: inherit;
  465. }
  466. }
  467. .multiple {
  468. @include column(10);
  469. padding-left: 0;
  470. padding-right: 0;
  471. }
  472. &.empty .add {
  473. margin: 0 0 0 -50px;
  474. }
  475. }
  476. // Make room for comments on the right when enabled
  477. .tab-content--comments-enabled .object {
  478. padding-right: 27%;
  479. &.full {
  480. padding-right: 36%;
  481. }
  482. @include media-breakpoint-up(lg) {
  483. padding-right: 30%;
  484. &.full {
  485. padding-right: 36%;
  486. }
  487. }
  488. }
  489. }
  490. .button.button--live {
  491. background-color: $color-white;
  492. color: $color-teal;
  493. border-radius: 2px;
  494. font-size: 14px;
  495. font-weight: 600;
  496. line-height: 2.3em;
  497. padding: 0 0.75em;
  498. .icon {
  499. @include svg-icon(1.25em);
  500. margin-right: 0.25em;
  501. }
  502. &:hover {
  503. background-color: $color-teal-darker;
  504. color: $color-white;
  505. }
  506. }
  507. .workflow-timeline {
  508. list-style: none;
  509. padding: 0;
  510. li {
  511. margin-bottom: 1.25em;
  512. position: relative;
  513. }
  514. li:not(:last-child)::after {
  515. content: '';
  516. color: $color-grey-3;
  517. position: absolute;
  518. top: 1.5em;
  519. left: calc(0.75em - 1px);
  520. height: 100%;
  521. border-left: 2px dotted;
  522. }
  523. .icon {
  524. fill: $color-grey-3;
  525. padding-right: 0.5em;
  526. }
  527. .in_progress {
  528. font-weight: 700;
  529. .icon {
  530. fill: $color-text-base;
  531. }
  532. }
  533. .approved .icon {
  534. fill: $color-teal;
  535. }
  536. .needs_changes .icon,
  537. .rejected .icon {
  538. fill: $color-orange;
  539. }
  540. .cancelled .icon {
  541. fill: $color-red-dark;
  542. }
  543. }
  544. // Media for Windows High Contrast
  545. @media (forced-colors: $media-forced-colours) {
  546. .object {
  547. border-top: 1px solid GrayText;
  548. .object-help {
  549. margin-bottom: 0;
  550. }
  551. }
  552. }