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