_page-editor.scss 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. @use 'sass:color';
  2. @use 'sass:map';
  3. @use 'sass:math';
  4. .page-editor {
  5. .content-wrapper {
  6. margin-bottom: 10em;
  7. overflow-x: hidden;
  8. }
  9. }
  10. .side-panel-open {
  11. @apply w-overflow-y-hidden sm:w-overflow-y-auto;
  12. }
  13. // An object is the basic wrapper around any field or group of fields in the editor interface
  14. .object {
  15. @include nice-padding();
  16. position: relative;
  17. &:first-child {
  18. border: 0;
  19. }
  20. &.focused {
  21. border-color: $color-input-focus-border;
  22. }
  23. fieldset,
  24. .field-row {
  25. padding-top: $object-title-height + 12px;
  26. }
  27. fieldset {
  28. padding-inline-start: 0;
  29. padding-inline-end: 0;
  30. .field-row {
  31. padding-top: 0;
  32. }
  33. }
  34. > .title-wrapper {
  35. box-sizing: border-box;
  36. height: $object-title-height;
  37. -webkit-font-smoothing: auto;
  38. background: $color-salmon-light;
  39. color: $color-text-base;
  40. padding: 0.9em 0 0.9em 5em;
  41. font-size: 0.95em;
  42. margin: 0;
  43. line-height: 1.5em;
  44. font-weight: normal;
  45. position: absolute;
  46. top: 0;
  47. inset-inline-start: 0;
  48. inset-inline-end: 0;
  49. z-index: 1;
  50. overflow: hidden;
  51. label {
  52. display: inline;
  53. font-weight: inherit;
  54. float: none;
  55. width: auto;
  56. color: inherit;
  57. font-size: inherit;
  58. }
  59. &:before {
  60. @include font-smoothing;
  61. text-shadow: none;
  62. font-family: $font-wagtail-icons;
  63. // UI Redesign: To be removed in page editor redesign
  64. content: map.get($icons, 'arrow-down');
  65. text-align: center;
  66. display: block;
  67. position: absolute;
  68. z-index: 2;
  69. font-size: 2em;
  70. top: 0;
  71. line-height: 1.8em;
  72. inset-inline-start: 0;
  73. width: $desktop-nice-padding;
  74. color: $color-white;
  75. padding: 0;
  76. margin: 0;
  77. background-color: $color-salmon;
  78. }
  79. }
  80. &.required {
  81. > .title-wrapper label:after {
  82. content: '*';
  83. color: theme('colors.critical.200');
  84. font-weight: bold;
  85. display: inline-block;
  86. margin-inline-start: 0.5em;
  87. line-height: 1em;
  88. font-size: 13px;
  89. }
  90. }
  91. // cursory styling for streamfield. Main styling in client/src/components/StreamField/StreamField.scss
  92. &.block_field {
  93. padding-inline-start: 20px;
  94. padding-inline-end: 20px;
  95. .object-layout_big-part {
  96. max-width: 100%;
  97. }
  98. fieldset {
  99. padding-bottom: 0;
  100. max-width: unset;
  101. // Workaround to make sure blocks do not overflow horizontally.
  102. min-width: 0;
  103. }
  104. .block_field > .field-content {
  105. width: 100%;
  106. }
  107. }
  108. .multiple {
  109. padding: 4.5em 0 0;
  110. fieldset {
  111. padding-top: 0;
  112. padding-bottom: 0;
  113. }
  114. }
  115. .fields {
  116. max-width: 100%;
  117. }
  118. // removes top padding from multiples used within another panel
  119. .fields .multiple {
  120. padding-top: 0;
  121. }
  122. .add {
  123. padding-top: 1em;
  124. }
  125. &.empty {
  126. border-bottom: 1px solid $color-white;
  127. > h3 {
  128. margin: 0;
  129. border-bottom: 1px solid $color-white;
  130. }
  131. // wrapper around add button for multiple objects. Default version is wordless plus button for contracted groups of fields
  132. .add {
  133. @include transition(background-color 0.2s ease);
  134. position: relative;
  135. z-index: 2;
  136. top: 0;
  137. inset-inline-start: 0;
  138. width: 3.3em;
  139. padding: 0;
  140. margin: 0 0 0 -20px;
  141. cursor: pointer;
  142. .button {
  143. border-radius: 0;
  144. overflow: visible;
  145. background-color: $color-salmon-light;
  146. font-size: 0; // helps fake the effect of t.ext-replace class, which can't be used here.
  147. width: 2em;
  148. // stylelint-disable max-nesting-depth
  149. &:before {
  150. position: relative;
  151. padding: 0;
  152. line-height: 1.8em; // specific height required as parent 'a' has no height
  153. font-size: 1.4rem;
  154. width: 1.8em;
  155. background-color: $color-salmon;
  156. }
  157. }
  158. }
  159. .multiple {
  160. padding: 0;
  161. }
  162. }
  163. &.collapsible {
  164. // li.collapsed gets its height from the fieldset only, which is now hidden
  165. // and h2 has position: absolute which doesn't add to it either, so it would be 0 without this
  166. min-height: 41px;
  167. .title-wrapper {
  168. &:before {
  169. // UI Redesign: To be removed in page editor redesign
  170. content: map.get($icons, 'collapse-up');
  171. cursor: pointer;
  172. }
  173. }
  174. &.collapsed {
  175. .title-wrapper {
  176. &:before {
  177. // UI Redesign: To be removed in page editor redesign
  178. content: map.get($icons, 'collapse-down');
  179. }
  180. }
  181. }
  182. }
  183. }
  184. @include media-breakpoint-up(sm) {
  185. .object {
  186. fieldset {
  187. // Override column mixin for column items.
  188. display: block;
  189. // Override column mixin for column items.
  190. float: none;
  191. max-width: 1024px;
  192. padding-inline-start: 0;
  193. padding-inline-end: 0;
  194. fieldset {
  195. width: 100%;
  196. }
  197. }
  198. .object-layout {
  199. display: flex;
  200. flex-flow: row-reverse wrap;
  201. &_small-part {
  202. flex: 1 0 0;
  203. }
  204. &_big-part {
  205. flex: 5 0 0;
  206. }
  207. }
  208. .multiple {
  209. @include column(10);
  210. padding-inline-start: 0;
  211. padding-inline-end: 0;
  212. > li {
  213. padding: 1em 10em 1em 1.5em;
  214. }
  215. }
  216. &.empty .add {
  217. margin: 0 0 0 -50px;
  218. }
  219. }
  220. // Make room for comments on the right when enabled
  221. .tab-content--comments-enabled .object {
  222. padding-inline-end: 27%;
  223. @include media-breakpoint-up(lg) {
  224. padding-inline-end: 30%;
  225. }
  226. }
  227. }
  228. // Media for Windows High Contrast
  229. @media (forced-colors: $media-forced-colours) {
  230. .object {
  231. border-top: 1px solid GrayText;
  232. }
  233. }