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