]> BookStack Code Mirror - bookstack/blob - resources/sass/_lists.scss
Removed throttling from web-end requests
[bookstack] / resources / sass / _lists.scss
1
2 .book-contents .entity-list-item {
3   .icon {
4     width: 4px;
5     border-radius: 1px;
6     justify-self: stretch;
7     align-self: stretch;
8     height: auto;
9     margin-inline-end: $-l;
10   }
11   .icon:after {
12     opacity: 0.5;
13   }
14   .icon svg {
15     display: none;
16   }
17   p {
18     margin-bottom: 0;
19   }
20   .inner-page {
21     padding-top: 0;
22     padding-bottom: 0;
23   }
24 }
25
26 .entity-list-item + .chapter-expansion {
27   display: flex;
28   padding: 0 $-m $-m $-m;
29   align-items: center;
30   border: 0;
31   width: 100%;
32   position: relative;
33   > .icon {
34     width: 4px;
35     height: auto;
36     border-radius: 0 0 1px 1px;
37     align-self: stretch;
38     flex-shrink: 0;
39     &:before {
40       position: absolute;
41       top: 0;
42       left: 0;
43       width: 100%;
44       height: 1px;
45       background-color: currentColor;
46       content: '';
47       opacity: 0.5;
48     }
49     &:after {
50       opacity: 0.5;
51     }
52   }
53   .icon svg {
54     display: none;
55   }
56   > .content {
57     flex: 1;
58   }
59   .chapter-expansion-toggle {
60     border-radius: 0 4px 4px 0;
61     padding: $-xs $-m;
62     width: 100%;
63     text-align: start;
64   }
65   .chapter-expansion-toggle:hover {
66     background-color: rgba(0, 0, 0, 0.06);
67   }
68 }
69
70 .entity-list-item.has-children {
71   padding-bottom: 0;
72   > .icon {
73     border-radius: 4px 4px 0 0;
74   }
75 }
76
77 .inset-list {
78   display: none;
79   .entity-list-item-name {
80     font-size: 1rem;
81   }
82   .entity-list-item-children {
83     padding-top: 0;
84     padding-bottom: 0;
85   }
86 }
87
88 .sidebar-page-nav {
89   $nav-indent: $-m;
90   list-style: none;
91   @include margin($-s, 0, $-m, $-xs);
92   position: relative;
93   &:after {
94     content: '';
95     display: block;
96     position: absolute;
97     left: 0;
98     @include rtl {
99       left: auto;
100       right: 0;
101     }
102     @include lightDark(background-color, rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2));
103     width: 2px;
104     top: 5px;
105     bottom: 5px;
106     z-index: 0;
107   }
108   li {
109     margin-bottom: 4px;
110     font-size: 0.95em;
111     position: relative;
112   }
113   .h1 {
114     padding-inline-start: $nav-indent;
115   }
116   .h2 {
117     padding-inline-start: $nav-indent * 1.5;
118   }
119   .h3 {
120     padding-inline-start: $nav-indent * 2;
121   }
122   .h4 {
123     padding-inline-start: $nav-indent * 2.5;
124   }
125   .h5 {
126     padding-inline-start: $nav-indent*3;
127   }
128   .h6 {
129     padding-inline-start: $nav-indent*3.5;
130   }
131   .current-heading {
132     font-weight: bold;
133   }
134   li:not(.current-heading) .sidebar-page-nav-bullet {
135     @include lightDark(background-color, #BBB, #666, true);
136   }
137   .sidebar-page-nav-bullet {
138     width: 6px;
139     height: 6px;
140     position: absolute;
141     left: -2px;
142     top: 30%;
143     border-radius: 50%;
144     box-shadow: 0 0 0 6px #F2F2F2;
145     @include lightDark(box-shadow, 0 0 0 6px #F2F2F2, 0 0 0 6px #111);
146     z-index: 1;
147     @include rtl {
148       left: auto;
149       right: -2px;
150     }
151   }
152 }
153
154 // Sidebar list
155 .book-tree .sidebar-page-list  {
156   list-style: none;
157   @include margin($-xs, -$-s, 0, -$-s);
158   padding-inline-start: 0;
159   padding-inline-end: 0;
160   position: relative;
161
162   &:after, .sub-menu:after {
163     content: '';
164     display: block;
165     position: absolute;
166     left: $-m;
167     top: 1rem;
168     bottom: 1rem;
169     border-inline-start: 4px solid rgba(0, 0, 0, 0.1);
170     z-index: 0;
171     @include rtl {
172       left: auto;
173       right: $-m;
174     }
175   }
176
177   ul {
178     list-style: none;
179     padding-inline-start: 1rem;
180     padding-inline-end: 0;
181   }
182
183   .entity-list-item {
184     padding-top: $-xxs;
185     padding-bottom: $-xxs;
186     background-clip: content-box;
187     border-radius: 0 3px 3px 0;
188     .content {
189       padding-top: $-xs;
190       padding-bottom: $-xs;
191       max-width: calc(100% - 20px);
192     }
193   }
194   .entity-list-item.selected {
195     background-color: rgba(0, 0, 0, 0.08);
196   }
197   .entity-list-item.no-hover {
198     margin-top: -$-xs;
199     padding-inline-end: 0;
200   }
201   .entity-list-item-name {
202     font-size: 1em;
203     margin: 0;
204   }
205   .chapter-child-menu {
206     font-size: .8rem;
207     margin-top: -.2rem;
208     margin-inline-start: -1rem;
209   }
210   [chapter-toggle] {
211     padding-inline-start: .7rem;
212     padding-bottom: .2rem;
213   }
214   .entity-list-item .icon {
215     z-index: 2;
216     width: 4px;
217     height: auto;
218     align-self: stretch;
219     flex-shrink: 0;
220     border-radius: 1px;
221     opacity: 0.6;
222   }
223   .entity-list-item .icon:after {
224     opacity: 1;
225   }
226   .entity-list-item .icon svg {
227     display: none;
228   }
229 }
230
231 .chapter-child-menu {
232   ul.sub-menu {
233     display: none;
234     padding-inline-start: 0;
235     position: relative;
236   }
237   [chapter-toggle].open + .sub-menu {
238     display: block;
239   }
240 }
241
242 // Sortable Lists
243 .sortable-page-list, .sortable-page-list ul {
244   list-style: none;
245 }
246 .sort-box {
247   margin-bottom: $-m;
248   padding: $-m $-xl;
249   position: relative;
250   &::before {
251     pointer-events: none;
252     content: '';
253     border-radius: 4px;
254     opacity: 0.5;
255     border: 2px solid var(--color-book);
256     display: block;
257     top: 0;
258     bottom: 0;
259     left: 0;
260     right: 0;
261     position: absolute;
262   }
263 }
264 .sort-box-options {
265   display: flex;
266   flex-wrap: wrap;
267   justify-content: space-between;
268 }
269 .sort-box-options .button {
270   margin-inline-start: 0;
271 }
272 .sortable-page-list {
273   margin-inline-start: 0;
274   padding: 0;
275   .entity-list-item > span:first-child {
276     align-self: flex-start;
277   }
278   .entity-list-item > div {
279     display: block;
280     flex: 1;
281   }
282   > ul {
283     margin-inline-start: 0;
284   }
285   ul {
286     margin-bottom: $-m;
287     margin-top: 0;
288     padding-inline-start: $-m;
289   }
290   li {
291     border: 1px solid #DDD;
292     margin-top: -1px;
293     min-height: 38px;
294   }
295   li.text-page, li.text-chapter {
296     border-inline-start: 2px solid currentColor;
297   }
298   li:first-child {
299     margin-top: $-xs;
300   }
301 }
302 .sortable-page-list li.placeholder {
303   position: relative;
304 }
305 .sortable-page-list li.placeholder:before {
306   position: absolute;
307 }
308
309 .activity-list-item {
310   padding: $-s 0;
311   display: grid;
312   grid-template-columns: min-content 1fr;
313   grid-column-gap: $-m;
314   font-size: 0.9em;
315 }
316 .card .activity-list-item {
317   padding: $-s $-m;
318 }
319
320 .user-list-item {
321   display: inline-grid;
322   padding: $-s;
323   grid-template-columns: min-content 1fr;
324   grid-column-gap: $-m;
325   font-size: 0.9em;
326   align-items: center;
327   > div:first-child {
328     line-height: 0;
329   }
330 }
331
332 ul.pagination {
333   display: inline-block;
334   list-style: none;
335   margin: $-m 0;
336   padding-inline-start: 1px;
337   li {
338     float: left;
339   }
340   li:first-child {
341     a, span {
342       border-radius: 3px 0 0 3px;
343     }
344   }
345   li:last-child {
346     a, span {
347       border-radius: 0 3px 3px 0;
348     }
349   }
350   a, span {
351     display: block;
352     padding: $-xxs $-s;
353     border: 1px solid #CCC;
354     margin-inline-start: -1px;
355     user-select: none;
356     &.disabled {
357       cursor: not-allowed;
358     }
359   }
360   li.active span {
361     @include lightDark(color, #444, #eee);
362     @include lightDark(background-color, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
363   }
364 }
365
366 .compact ul.pagination {
367   margin: 0;
368 }
369
370 .entity-list, .icon-list {
371   margin: 0 (-$-m);
372   h4 {
373     margin: 0;
374   }
375   hr {
376     margin: 0;
377   }
378   .text-small.text-muted {
379     color: #AAA;
380     font-size: 0.75em;
381     margin-top: $-xs;
382   }
383   .text-muted p.text-muted {
384     margin-top: 0;
385   }
386   .page.draft .text-page {
387     color: var(--color-page-draft);
388     fill: var(--color-page-draft);
389   }
390   > .dropdown-container {
391     display: block;
392   }
393 }
394
395 .icon-list hr {
396   margin: $-s $-m;
397   max-width: 140px;
398   opacity: 0.25;
399   height: 1.1px;
400 }
401
402 .icon-list hr + hr, .icon-list hr:first-child, .icon-list hr:last-child {
403   display: none;
404 }
405
406 .entity-list-item, .icon-list-item {
407   padding: $-s $-m;
408   display: flex;
409   align-items: center;
410   background-color: transparent;
411   border: 0;
412   width: 100%;
413   position: relative;
414   word-break: break-word;
415   h4 a {
416     color: #666;
417   }
418   > span:first-child {
419     margin-inline-end: $-m;
420     flex-basis: 1.88em;
421     flex: none;
422   }
423   > span:last-child {
424     flex: 1;
425     text-align: start;
426   }
427   &:not(.no-hover) {
428     cursor: pointer;
429   }
430   &:not(.no-hover):hover {
431     text-decoration: none;
432     background-color: rgba(0, 0, 0, 0.1);
433     border-radius: 4px;
434   }
435   &.outline-hover {
436     border: 1px solid transparent;
437   }
438   &.outline-hover:hover {
439     background-color: transparent;
440     border-color: rgba(0, 0, 0, 0.1);
441   }
442   &:focus {
443     @include lightDark(background-color, #eee, #222);
444     outline: 1px dotted #666;
445     outline-offset: -2px;
446   }
447 }
448
449 .entity-list-item-path-sep {
450   display: inline-block;
451   vertical-align: top;
452   position: relative;
453   top: 1px;
454   svg {
455     margin-inline-end: 0;
456   }
457 }
458
459 .card .entity-list-item:not(.no-hover):hover {
460   @include lightDark(background-color, #F2F2F2, #2d2d2d)
461 }
462 .card .entity-list-item .entity-list-item:hover {
463   background-color: #EEEEEE;
464 }
465
466 .entity-list-item-children {
467   padding: $-m;
468   > div {
469     overflow: hidden;
470     padding: $-xs 0;
471     margin-top: -$-xs;
472   }
473   .entity-chip {
474     text-overflow: ellipsis;
475     height: 2.5em;
476     overflow: hidden;
477     text-align: start;
478     display: block;
479     white-space: nowrap;
480   }
481 }
482
483 .entity-list-item-image {
484   align-self: stretch;
485   width: 140px;
486   flex: none;
487   background-size: cover;
488   background-position: 50% 50%;
489   border-radius: 3px;
490   position: relative;
491   margin-inline-end: $-l;
492
493   &.entity-list-item-image-wide {
494     width: 220px;
495   }
496
497   .svg-icon {
498     @include lightDark(color, #fff, rgba(255, 255, 255, 0.6));
499     font-size: 1.66rem;
500     margin-inline-end: 0;
501     position: absolute;
502     bottom: $-xs;
503     left: $-xs;
504   }
505
506   @include smaller-than($m) {
507     width: 80px;
508   }
509 }
510
511 .chapter > .entity-list-item-image {
512   width: 60px;
513 }
514
515 .entity-list.compact {
516   font-size: 0.6 * $fs-m;
517   h4, a {
518     line-height: 1.2;
519   }
520   .entity-item-snippet {
521     display: none;
522   }
523   .entity-list-item p {
524     font-size: $fs-m * 0.8;
525     padding-top: $-xs;
526   }
527   p {
528     margin: 0;
529   }
530   > p.empty-text {
531     display: block;
532     font-size: $fs-m;
533   }
534   hr {
535     margin: 0;
536   }
537   @include smaller-than($m) {
538     h4 {
539       font-size: 1.666em;
540     }
541   }
542 }
543
544 .dropdown-container {
545   display: inline-block;
546   vertical-align: top;
547   position: relative;
548 }
549
550 .dropdown-menu {
551   display: none;
552   position: absolute;
553   z-index: 999;
554   top: 0;
555   list-style: none;
556   right: 0;
557   margin: $-m 0;
558   @include lightDark(background-color, #fff, #333);
559   box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.1);
560   border-radius: 1px;
561   border: 1px solid #EEE;
562   @include lightDark(border-color, #eee, #000);
563   min-width: 180px;
564   padding: $-xs 0;
565   @include lightDark(color, #555, #eee);
566   fill: currentColor;
567   text-align: start !important;
568   &.wide {
569     min-width: 220px;
570   }
571   .text-muted {
572     color: #999;
573     fill: #999;
574   }
575   li.active a {
576     font-weight: 600;
577   }
578   a, button {
579     display: block;
580     padding: $-xs $-m;
581     @include lightDark(color, #555, #eee);
582     fill: currentColor;
583     white-space: nowrap;
584     &:hover, &:focus {
585       text-decoration: none;
586       background-color: var(--color-primary-light);
587       color: var(--color-primary);
588     }
589     &:focus {
590       outline: 1px solid var(--color-primary);
591       outline-offset: -2px;
592     }
593     svg {
594       margin-inline-end: $-s;
595       display: inline-block;
596       width: 16px;
597     }
598   }
599   button {
600     width: 100%;
601     text-align: start;
602   }
603   li.border-bottom {
604     border-bottom: 1px solid #DDD;
605   }
606 }
607
608 // Books grid view
609 .featured-image-container {
610   position: relative;
611   overflow: hidden;
612   min-height: 140px;
613   background-size: cover;
614   background-position: 50% 50%;
615   transition: opacity ease-in-out 240ms;
616   a {
617     display: block;
618   }
619   img {
620     display: block;
621     width: 100%;
622     max-width: 100%;
623     height: auto;
624   }
625 }
626 .featured-image-container-wrap {
627   position: relative;
628   .svg-icon {
629     @include lightDark(color, #fff, rgba(255, 255, 255, 0.6));
630     font-size: 2rem;
631     margin-inline-end: 0;
632     position: absolute;
633     bottom: 10px;
634     left: 6px;
635   }
636 }
637 .grid-card:hover .featured-image-container {
638   opacity: .5;
639 }
640
641 .action-link-list {
642   //padding: $-s 0;
643 }
644 .action-link {
645   background: transparent;
646   border: none;
647   color: currentColor;
648   padding: $-m 0;
649 }
650
651 .active-link-list {
652   a {
653     display: inline-block;
654     padding: $-s;
655   }
656   a:not(.active) {
657     @include lightDark(color, #444, #666);
658   }
659   a:hover {
660     @include lightDark(background-color, rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
661     border-radius: 3px;
662     text-decoration: none;
663   }
664 }