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