]> BookStack Code Mirror - bookstack/blob - resources/sass/_pages.scss
Started support for WYSIWYG details/summary blocks
[bookstack] / resources / sass / _pages.scss
1 .page-editor {
2   display: flex;
3   flex-direction: column;
4   align-items: stretch;
5   overflow: hidden;
6
7   .edit-area {
8     flex: 1;
9     flex-direction: column;
10     z-index: 10;
11   }
12
13   .mce-tinymce {
14         box-shadow: none;
15   }
16
17   .mce-top-part::before {
18     box-shadow: none;
19   }
20 }
21
22 body.tox-fullscreen .page-editor .edit-area,
23 body.markdown-fullscreen .page-editor .edit-area {
24   z-index: 12;
25 }
26
27 body.tox-fullscreen, body.markdown-fullscreen {
28   .page-editor, .flex-fill {
29     overflow: visible;
30   }
31 }
32
33 @include smaller-than($s) {
34   .page-edit-toolbar {
35     overflow-x: scroll;
36     overflow-y: visible;
37   }
38   .page-edit-toolbar .grid.third {
39     display: block;
40     white-space: nowrap;
41     > div {
42       display: inline-block;
43     }
44   }
45 }
46
47 .page-save-mobile-button {
48   position: fixed;
49   z-index: 30;
50   border-radius: 50%;
51   width: 56px;
52   height: 56px;
53   font-size: 24px;
54   right: $-m;
55   bottom: $-s;
56   box-shadow: $bs-hover;
57   background-color: currentColor;
58   text-align: center;
59   svg {
60     fill: #FFF;
61     margin-inline-end: 0;
62   }
63 }
64
65 .draft-notification {
66   pointer-events: none;
67   transform: scale(0);
68   transition: transform ease-in-out 120ms;
69   transform-origin: 50% 50%;
70   &.visible {
71     transform: scale(1);
72   }
73 }
74
75 .page-style.editor {
76   padding: 0 !important;
77 }
78
79 .page-content {
80   width: 100%;
81   max-width: 840px;
82   margin: 0 auto;
83   overflow-wrap: break-word;
84   .align-left {
85     text-align: left;
86   }
87   img.align-left, table.align-left {
88     float: left !important;
89     margin: $-xs $-m $-m 0;
90   }
91   .align-right {
92     text-align: right !important;
93   }
94   img.align-right, table.align-right {
95     float: right !important;
96     margin: $-xs 0 $-xs $-s;
97   }
98   .align-center {
99     text-align: center;
100   }
101   img.align-center {
102     display: block;
103   }
104   img.align-center, table.align-center {
105     margin-left: auto;
106     margin-right: auto;
107   }
108   img {
109     max-width: 100%;
110     height:auto;
111   }
112   h1, h2, h3, h4, h5, h6, pre {
113     clear: left;
114   }
115   hr {
116     clear: both;
117     margin: $-m 0;
118   }
119   table {
120     hyphens: auto;
121     table-layout: fixed;
122     max-width: 100%;
123     height: auto !important;
124   }
125
126   // diffs
127   ins,
128   del {
129     text-decoration: none;
130   }
131   ins {
132     background: #dbffdb;
133   }
134   del {
135     background: #FFECEC;
136   }
137
138   details {
139     border: 1px solid #DDD;
140     margin-bottom: 1em;
141     padding: $-s;
142   }
143   details > summary {
144     margin-top: -$-s;
145     margin-left: -$-s;
146     margin-right: -$-s;
147     margin-bottom: -$-s;
148     font-weight: bold;
149     background-color: #EEEEEE;
150     padding: $-xs $-s;
151   }
152   details[open] > summary {
153     margin-bottom: 0;
154   }
155   details > summary + * {
156     margin-top: .2em;
157   }
158
159   &.page-revision {
160     pre code {
161       white-space: pre-wrap;
162     }
163   }
164 }
165
166 // Page content pointers
167 .pointer-container {
168   position: relative;
169   display: none;
170   left: 0;
171   z-index: 10;
172 }
173 .pointer {
174   border: 1px solid #CCC;
175   @include lightDark(border-color, #ccc, #000);
176   display: flex;
177   align-items: center;
178   justify-items: center;
179   padding: $-s $-s;
180   border-radius: 4px;
181   box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.1);
182   position: absolute;
183   top: -60px;
184   @include lightDark(background-color, #fff, #333);
185   width: 275px;
186   z-index: 55;
187
188   &.is-page-editable {
189     width: 328px;
190   }
191
192   &:before {
193     position: absolute;
194     left: 50%;
195     bottom: -9px;
196     width: 16px;
197     height: 16px;
198     margin-inline-start: -8px;
199     content: '';
200     display: block;
201     transform: rotate(45deg);
202     transform-origin: 50% 50%;
203     border-block-end: 1px solid #CCC;
204     border-inline-end: 1px solid #CCC;
205     z-index: 56;
206     @include lightDark(background-color, #fff, #333);
207     @include lightDark(border-color, #ccc, #000);
208   }
209   input, button, a {
210     position: relative;
211     border-radius: 0;
212     height: 28px;
213     font-size: 12px;
214     vertical-align: top;
215     padding: 5px 16px;
216   }
217   input {
218     background-color: #FFF;
219     border: 1px solid #DDD;
220     @include lightDark(border-color, #ddd, #000);
221     color: #666;
222     width: 172px;
223     z-index: 40;
224     padding: 5px 10px;
225   }
226   span.icon {
227     fill: #444;
228     cursor: pointer;
229     user-select: none;
230     display: inline-block;
231     line-height: 1;
232   }
233   .input-group .button {
234     line-height: 1;
235     margin: 0 0 0 -4px;
236     box-shadow: none;
237   }
238   a.button {
239     margin: 0;
240   }
241   .svg-icon {
242     width: 1.2em;
243     height: 1.2em;
244   }
245   .button {
246     @include lightDark(border-color, #ddd, #000);
247   }
248 }
249
250 // Attribute form
251 .floating-toolbox {
252   border: 1px solid #DDD;
253   @include lightDark(background-color, #fff, #222);
254   @include lightDark(border-color, #DDD, #000);
255   right: $-xl*2;
256   width: 48px;
257   overflow: hidden;
258   align-items: stretch;
259   flex-direction: row;
260   display: flex;
261   transition: width ease-in-out 180ms;
262   margin-top: -1px;
263   min-height: 0;
264   &.open {
265     width: 480px;
266   }
267   [toolbox-toggle] svg {
268     transition: transform ease-in-out 180ms;
269   }
270   [toolbox-toggle] {
271     transition: background-color ease-in-out 180ms;
272   }
273   &.open [toolbox-toggle] {
274     background-color: rgba(255, 0, 0, 0.29);
275   }
276   &.open [toolbox-toggle] svg {
277     transform: rotate(180deg);
278   }
279   > div {
280     flex: 1;
281     position: relative;
282   }
283   .tabs {
284     display: block;
285     border-inline-end: 1px solid #DDD;
286     @include lightDark(border-color, #ddd, #000);
287     width: 48px;
288     flex: 0 1 auto;
289   }
290   .tabs svg {
291     padding: 0;
292     margin: 0;
293   }
294   .tabs > button {
295     @include lightDark(color, rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.5));
296     display: block;
297     cursor: pointer;
298     padding: $-s $-m;
299     font-size: 16px;
300     line-height: 1.6;
301     border-bottom: 1px solid rgba(255, 255, 255, 0.3);
302   }
303   &.open .tabs > button.active {
304     @include lightDark(color, #444, #EEE);
305     background-color: rgba(0, 0, 0, 0.1);
306   }
307   div[toolbox-tab-content] {
308     padding-bottom: 45px;
309     display: flex;
310     flex: 1;
311     flex-direction: column;
312     min-height: 0;
313     overflow-y: scroll;
314   }
315   h4 {
316     font-size: 24px;
317     margin: $-m 0 0 0;
318     padding: 0 $-l $-s $-l;
319   }
320   .tags input {
321     max-width: 100%;
322     width: 100%;
323     min-width: 50px;
324   }
325   .tags td, .inline-start-table > div > div > div {
326     padding-inline-end: $-s;
327     padding-top: $-s;
328     position: relative;
329   }
330   .handle {
331     user-select: none;
332     cursor: move;
333     fill: #999;
334   }
335   form {
336     display: flex;
337     flex: 1;
338     flex-direction: column;
339     overflow-y: scroll;
340   }
341   table td, table th {
342     overflow: visible;
343   }
344 }
345
346 [toolbox-tab-content] {
347   display: none;
348 }
349
350 .suggestion-box {
351   top: auto;
352   margin: -4px 0 0;
353   right: auto;
354   left: 0;
355   padding: 0;
356   li {
357     display: block;
358     border-bottom: 1px solid #DDD;
359     &:last-child {
360       border-bottom: 0;
361     }
362   }
363 }
364
365 .comments-container h5 {
366   color: #888;
367   font-weight: normal;
368   margin-top: 0.5em;
369 }
370
371 .comment-editor .CodeMirror, .comment-editor .CodeMirror-scroll {
372   min-height: 175px;
373 }
374
375 /* FIXME - Ugly hack to modify the media plugin for TinyMCE */
376 .mce-floatpanel[aria-label="Insert/edit media"] {
377   .mce-open {
378     display: none;
379   }
380 }
381
382 .entity-list-item > span:first-child, .icon-list-item > span:first-child, .chapter-expansion > .icon {
383   font-size: 0.8rem;
384   width: 1.88em;
385   height: 1.88em;
386   display: flex;
387   align-items: center;
388   justify-content: center;
389   text-align: center;
390   border-radius: 1em;
391   position: relative;
392   overflow: hidden;
393   svg {
394     margin: 0;
395     bottom: 0;
396   }
397   &:after {
398     content: '';
399     position: absolute;
400     background-color: currentColor;
401     opacity: 0.2;
402     left: 0;
403     top: 0;
404     width: 100%;
405     height: 100%;
406   }
407 }
408
409 .entity-chip {
410   display: inline-block;
411   align-items: center;
412   justify-content: center;
413   text-align: center;
414   font-size: 0.9em;
415   border-radius: 3px;
416   position: relative;
417   overflow: hidden;
418   padding: $-xs $-s;
419   fill: currentColor;
420   opacity: 0.85;
421   transition: opacity ease-in-out 120ms;
422   &:after {
423     content: '';
424     position: absolute;
425     background-color: currentColor;
426     opacity: 0.15;
427     left: 0;
428     top: 0;
429     width: 100%;
430     height: 100%;
431   }
432   &:hover {
433     text-decoration: none;
434     opacity: 1;
435   }
436   @media (prefers-contrast: more) {
437     opacity: 1;
438   }
439 }