]> BookStack Code Mirror - bookstack/blob - resources/sass/_components.scss
Added tests and translations for dark-mode components
[bookstack] / resources / sass / _components.scss
1 // System wide notifications
2 [notification] {
3   position: fixed;
4   top: 0;
5   right: 0;
6   margin: $-xl;
7   padding: $-m $-l;
8   background-color: #FFF;
9   @include lightDark(background-color, #fff, #444);
10   border-radius: 4px;
11   border-inline-start: 6px solid currentColor;
12   box-shadow: $bs-large;
13   z-index: 999999;
14   cursor: pointer;
15   max-width: 360px;
16   transition: transform ease-in-out 280ms;
17   transform: translateX(580px);
18   display: grid;
19   grid-template-columns: 42px 1fr 12px;
20   color: #444;
21   font-weight: 700;
22   span, svg {
23     vertical-align: middle;
24     justify-self: center;
25     align-self: center;
26   }
27   svg {
28     width: 2.8rem;
29     height: 2.8rem;
30     padding-inline-end: $-s;
31     fill: currentColor;
32   }
33   .dismiss {
34     margin-top: -8px;
35     svg {
36       height: 1.0rem;
37       @include lightDark(color, #444, #888);
38     }
39   }
40   span {
41     vertical-align: middle;
42     line-height: 1.3;
43     @include whenDark {
44       color: #BBB;
45     }
46   }
47   &.pos {
48     color: $positive;
49   }
50   &.neg {
51     color: $negative;
52   }
53   &.warning {
54     color: $warning;
55   }
56   &.showing {
57     transform: translateX(0);
58   }
59   &.showing:hover {
60     transform: translate3d(0, -2px, 0);
61   }
62 }
63
64 [chapter-toggle] {
65   cursor: pointer;
66   margin: 0;
67   transition: all ease-in-out 180ms;
68   user-select: none;
69   svg[data-icon="caret-right"] {
70     margin-inline-end: 0;
71     font-size: 1rem;
72     transition: all ease-in-out 180ms;
73     transform: rotate(0deg);
74     transform-origin: 50% 50%;
75   }
76   &.open svg[data-icon="caret-right"] {
77     transform: rotate(90deg);
78   }
79   svg[data-icon="caret-right"] + * {
80     margin-inline-start: $-xs;
81   }
82 }
83
84 [overlay] {
85   @include lightDark(background-color, rgba(0, 0, 0, 0.333), rgba(0, 0, 0, 0.6));
86   position: fixed;
87   z-index: 95536;
88   width: 100%;
89   height: 100%;
90   min-width: 100%;
91   min-height: 100%;
92   top: 0;
93   left: 0;
94   right: 0;
95   bottom: 0;
96   align-items: center;
97   justify-content: center;
98   display: none;
99 }
100
101 .popup-body-wrap {
102   display: flex;
103 }
104
105 .popup-body {
106   @include lightDark(background-color, #fff, #333);
107   max-height: 90%;
108   max-width: 1200px;
109   width: 90%;
110   height: auto;
111   margin: 2% auto;
112   border-radius: 4px;
113   box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.3);
114   overflow: hidden;
115   z-index: 999;
116   display: flex;
117   flex-direction: column;
118   &.small {
119     margin: 2% auto;
120     width: 800px;
121     max-width: 90%;
122   }
123   &:before {
124     display: flex;
125     align-self: flex-start;
126   }
127   .popup-content {
128     overflow-y: auto;
129   }
130   &:focus {
131     outline: 0;
132   }
133 }
134
135 .popup-footer button, .popup-header-close {
136   position: absolute;
137   top: 0;
138   right: 0;
139   margin: 0;
140   height: 40px;
141   border-radius: 0;
142   box-shadow: none;
143   &:active {
144     outline: 0;
145   }
146 }
147 .popup-header-close {
148   background-color: transparent;
149   border: 0;
150   color: #FFF;
151   font-size: 16px;
152   padding: 0 $-m;
153 }
154
155 .popup-header, .popup-footer {
156   display: block !important;
157   position: relative;
158   height: 40px;
159   flex: none !important;
160   .popup-title {
161     color: #FFF;
162     padding: 8px $-m;
163   }
164 }
165 body.flexbox-support #entity-selector-wrap .popup-body .form-group {
166   height: 444px;
167   min-height: 444px;
168 }
169 #entity-selector-wrap .popup-body .form-group {
170   margin: 0;
171 }
172 .popup-body .entity-selector-container {
173   flex: 1;
174 }
175
176 .image-manager-body {
177   min-height: 70vh;
178 }
179
180 .dropzone-container {
181   position: relative;
182   @include lightDark(background-color, #eee, #222);
183   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23a9a9a9' fill-opacity='0.52' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
184 }
185
186 .image-manager-list .image {
187   display: block;
188   position: relative;
189   border-radius: 0;
190   float: left;
191   margin: 0;
192   cursor: pointer;
193   width: (100%/6);
194   height: auto;
195   @include lightDark(border-color, #ddd, #000);
196   box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
197   transition: all cubic-bezier(.4, 0, 1, 1) 160ms;
198   overflow: hidden;
199   &.selected {
200     //transform: scale3d(0.92, 0.92, 0.92);
201     border: 4px solid #FFF;
202     overflow: hidden;
203     border-radius: 8px;
204     box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
205   }
206   img {
207     width: 100%;
208     max-width: 100%;
209     display: block;
210   }
211   .image-meta {
212     position: absolute;
213     width: 100%;
214     bottom: 0;
215     left: 0;
216     color: #EEE;
217     background-color: rgba(0, 0, 0, 0.4);
218     font-size: 10px;
219     padding: 3px 4px;
220     span {
221       display: block;
222     }
223   }
224   @include smaller-than($xl) {
225     width: (100%/4);
226   }
227   @include smaller-than($m) {
228     .image-meta {
229       display: none;
230     }
231   }
232 }
233
234 #image-manager .load-more {
235   display: block;
236   text-align: center;
237   @include lightDark(background-color, #EEE, #444);
238   padding: $-s $-m;
239   color: #AAA;
240   clear: both;
241   font-size: 20px;
242   cursor: pointer;
243   font-style: italic;
244 }
245
246 .image-manager-sidebar {
247   width: 300px;
248   overflow-y: auto;
249   overflow-x: hidden;
250   border-inline-start: 1px solid #DDD;
251   @include lightDark(border-color, #ddd, #000);
252   .inner {
253     padding: $-m;
254   }
255   img {
256     max-width: 100%;
257     max-height: 180px;
258     display: block;
259     margin: 0 auto $-m auto;
260     box-shadow: 0 1px 21px 1px rgba(76, 76, 76, 0.3);
261   }
262   .image-manager-viewer {
263     height: 196px;
264     display: flex;
265     align-items: center;
266     justify-content: center;
267     a {
268       display: inline-block;
269     }
270   }
271   .dropzone-container {
272     border-bottom: 1px solid #DDD;
273     @include lightDark(border-color, #ddd, #000);
274   }
275 }
276
277 .image-manager-list {
278   overflow-y: scroll;
279   flex: 1;
280 }
281
282 .image-manager-content {
283   display: flex;
284   flex-direction: column;
285   flex: 1;
286   .container {
287     width: 100%;
288   }
289   .full-tab {
290     text-align: center;
291   }
292 }
293
294 // Dropzone
295 /*
296  * The MIT License
297  * Copyright (c) 2012 Matias Meno <[email protected]>
298  */
299 .dz-message {
300   font-size: 1em;
301   line-height: 2.35;
302   font-style: italic;
303   color: #888;
304   text-align: center;
305   cursor: pointer;
306   padding: $-l $-m;
307   transition: all ease-in-out 120ms;
308 }
309
310 .dz-drag-hover .dz-message {
311   background-color: rgb(16, 126, 210);
312   color: #EEE;
313 }
314
315 @keyframes passing-through {
316   0% {
317     opacity: 0;
318     transform: translateY(40px);
319   }
320   30%, 70% {
321     opacity: 1;
322     transform: translateY(0px);
323   }
324   100% {
325     opacity: 0;
326     transform: translateY(-40px);
327   }
328 }
329
330 @keyframes slide-in {
331   0% {
332     opacity: 0;
333     transform: translateY(40px);
334   }
335   30% {
336     opacity: 1;
337     transform: translateY(0px);
338   }
339 }
340
341 @keyframes pulse {
342   0% {
343     transform: scale(1);
344   }
345   10% {
346     transform: scale(1.1);
347   }
348   20% {
349     transform: scale(1);
350   }
351 }
352
353 .dropzone, .dropzone * {
354   box-sizing: border-box;
355 }
356
357 .dz-preview {
358   position: relative;
359   display: inline-block;
360   vertical-align: top;
361   margin: 12px;
362   min-height: 80px;
363 }
364
365 .dz-preview:hover {
366   z-index: 1000;
367 }
368
369 .dz-preview:hover .dz-details {
370   opacity: 1;
371 }
372
373 .dz-preview.dz-file-preview .dz-image {
374   border-radius: 4px;
375   background: #e9e9e9;
376 }
377
378 .dz-preview.dz-file-preview .dz-details {
379   opacity: 1;
380 }
381
382 .dz-preview.dz-image-preview {
383   background: white;
384 }
385
386 .dz-preview.dz-image-preview .dz-details {
387   transition: opacity 0.2s linear;
388 }
389
390 .dz-preview .dz-remove {
391   font-size: 13px;
392   text-align: center;
393   display: block;
394   cursor: pointer;
395   border: none;
396   margin-top: 3px;
397 }
398
399 .dz-preview .dz-remove:hover {
400   text-decoration: underline;
401 }
402
403 .dz-preview:hover .dz-details {
404   opacity: 1;
405 }
406
407 .dz-preview .dz-details {
408   z-index: 20;
409   position: absolute;
410   top: 0;
411   left: 0;
412   opacity: 0;
413   font-size: 10px;
414   min-width: 100%;
415   max-width: 100%;
416   padding: 6px 3px;
417   text-align: center;
418   color: rgba(0, 0, 0, 0.9);
419   line-height: 150%;
420 }
421
422 .dz-preview .dz-details .dz-size {
423   margin-bottom: 0.5em;
424   font-size: 12px;
425 }
426
427 .dz-preview .dz-details .dz-filename {
428   white-space: nowrap;
429 }
430
431 .dz-preview .dz-details .dz-filename:hover span {
432   border: 1px solid rgba(200, 200, 200, 0.8);
433   background-color: rgba(255, 255, 255, 0.8);
434 }
435
436 .dz-preview .dz-details .dz-filename:not(:hover) {
437   overflow: hidden;
438   text-overflow: ellipsis;
439 }
440
441 .dz-preview .dz-details .dz-filename:not(:hover) span {
442   border: 1px solid transparent;
443 }
444
445 .dz-preview .dz-details .dz-filename span {
446   background-color: rgba(255, 255, 255, 0.4);
447   padding: 0 0.4em;
448   border-radius: 3px;
449 }
450
451 .dz-preview:hover .dz-image img {
452   filter: blur(8px);
453 }
454
455 .dz-preview .dz-image {
456   border-radius: 4px;
457   overflow: hidden;
458   width: 80px;
459   height: 80px;
460   position: relative;
461   display: block;
462   z-index: 10;
463 }
464
465 .dz-preview .dz-image img {
466   display: block;
467 }
468
469 .dz-preview.dz-success .dz-success-mark {
470   animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
471 }
472
473 .dz-preview.dz-error .dz-error-mark {
474   opacity: 1;
475   animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
476 }
477
478 .dz-preview .dz-success-mark, .dz-preview .dz-error-mark {
479   pointer-events: none;
480   opacity: 0;
481   z-index: 1001;
482   position: absolute;
483   display: block;
484   top: 50%;
485   left: 50%;
486   margin-inline-start: -27px;
487   margin-top: -35px;
488 }
489
490 .dz-preview .dz-success-mark svg, .dz-preview .dz-error-mark svg {
491   display: block;
492   width: 54px;
493   height: 54px;
494 }
495
496 .dz-preview.dz-processing .dz-progress {
497   opacity: 1;
498   transition: all 0.2s linear;
499 }
500
501 .dz-preview.dz-complete .dz-progress {
502   opacity: 0;
503   transition: opacity 0.4s ease-in;
504 }
505
506 .dz-preview:not(.dz-processing) .dz-progress {
507   animation: pulse 6s ease infinite;
508 }
509
510 .dz-preview .dz-progress {
511   opacity: 1;
512   z-index: 1000;
513   pointer-events: none;
514   position: absolute;
515   height: 16px;
516   left: 50%;
517   top: 50%;
518   margin-top: -8px;
519   width: 80px;
520   margin-inline-start: -40px;
521   background: rgba(255, 255, 255, 0.9);
522   transform: scale(1);
523   border-radius: 8px;
524   overflow: hidden;
525 }
526
527 .dz-preview .dz-progress .dz-upload {
528   background: #333;
529   background: linear-gradient(to bottom, #666, #444);
530   position: absolute;
531   top: 0;
532   left: 0;
533   bottom: 0;
534   width: 0;
535   transition: width 300ms ease-in-out;
536 }
537
538 .dz-preview.dz-error .dz-error-message {
539   display: block;
540 }
541
542 .dz-preview.dz-error {
543   .dz-image, .dz-details {
544     &:hover ~ .dz-error-message {
545       opacity: 1;
546       pointer-events: auto;
547     }
548   }
549 }
550
551 .dz-preview .dz-error-message {
552   pointer-events: none;
553   z-index: 1000;
554   position: absolute;
555   display: block;
556   display: none;
557   opacity: 0;
558   transition: opacity 0.3s ease;
559   border-radius: 4px;
560   font-size: 12px;
561   line-height: 1.2;
562   top: 88px;
563   left: -12px;
564   width: 160px;
565   background: $negative;
566   padding: $-xs;
567   color: white;
568 }
569
570 .dz-preview .dz-error-message:after {
571   content: '';
572   position: absolute;
573   top: -6px;
574   left: 44px;
575   width: 0;
576   height: 0;
577   border-inline-start: 6px solid transparent;
578   border-inline-end: 6px solid transparent;
579   border-bottom: 6px solid $negative;
580 }
581
582
583 .tab-container .nav-tabs {
584   text-align: start;
585   border-bottom: 1px solid #DDD;
586   @include lightDark(border-color, #ddd, #444);
587   margin-bottom: $-m;
588   .tab-item {
589     padding: $-s;
590     @include lightDark(color, #666, #999);
591     &.selected {
592       border-bottom-width: 3px;
593     }
594   }
595 }
596
597 .nav-tabs {
598   text-align: center;
599   a, .tab-item {
600     padding: $-m;
601     display: inline-block;
602     @include lightDark(color, #666, #999);
603     cursor: pointer;
604     &.selected {
605       border-bottom: 2px solid var(--color-primary);
606     }
607   }
608 }
609
610 .image-picker .none {
611   display: none;
612 }
613
614 #code-editor .CodeMirror {
615   height: 400px;
616 }
617
618 #code-editor .lang-options {
619   max-width: 480px;
620   margin-bottom: $-s;
621   a {
622     margin-inline-end: $-xs;
623     text-decoration: underline;
624   }
625 }
626
627 @include smaller-than($m) {
628   #code-editor .lang-options {
629     max-width: 100%;
630   }
631   #code-editor .CodeMirror {
632     height: 200px;
633   }
634 }
635
636 .comment-box {
637   border-radius: 4px;
638   border: 1px solid #DDD;
639   @include lightDark(border-color, #ddd, #000);
640   @include lightDark(background-color, #FFF, #222);
641   .content {
642     font-size: 0.666em;
643     p, ul, ol {
644       font-size: $fs-m;
645       margin: .5em 0;
646     }
647   }
648   .actions {
649     opacity: 0;
650     transition: opacity ease-in-out 120ms;
651   }
652   &:hover .actions, &:focus-within .actions {
653     opacity: 1;
654   }
655 }
656
657 .comment-box .header {
658   .meta {
659     img, a, span {
660       display: inline-block;
661       vertical-align: top;
662     }
663     a, span {
664       padding: $-xxs 0 $-xxs 0;
665       line-height: 1.6;
666     }
667     a { color: #666; }
668     span {
669       padding-inline-start: $-xxs;
670     }
671   }
672   .text-muted {
673     color: #999;
674   }
675 }
676
677 #tag-manager .drag-card {
678   max-width: 500px;
679 }
680
681 .permissions-table [permissions-table-toggle-all-in-row] {
682   display: none;
683 }
684 .permissions-table tr:hover [permissions-table-toggle-all-in-row] {
685   display: inline;
686 }
687
688 .template-item {
689   cursor: pointer;
690   position: relative;
691   &:hover, .template-item-actions button:hover {
692     background-color: #F2F2F2;
693   }
694   .template-item-actions {
695     position: absolute;
696     top: 0;
697     right: 0;
698     width: 50px;
699     height: 100%;
700     display: flex;
701     flex-direction: column;
702     border-inline-start: 1px solid #DDD;
703   }
704   .template-item-actions button {
705     cursor: pointer;
706     flex: 1;
707     background: #FFF;
708     border: 0;
709     border-top: 1px solid #DDD;
710   }
711   .template-item-actions button:first-child {
712     border-top: 0;
713   }
714 }