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