]> BookStack Code Mirror - bookstack/blob - resources/sass/_lists.scss
Rolled dark mode out to the editors
[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     color: #FFF;
362   }
363 }
364
365 .compact ul.pagination {
366   margin: 0;
367 }
368
369 .entity-list, .icon-list {
370   margin: 0 (-$-m);
371   h4 {
372     margin: 0;
373   }
374   hr {
375     margin: 0;
376   }
377   .text-small.text-muted {
378     color: #AAA;
379     font-size: 0.75em;
380     margin-top: $-xs;
381   }
382   .text-muted p.text-muted {
383     margin-top: 0;
384   }
385   .page.draft .text-page {
386     color: var(--color-page-draft);
387     fill: var(--color-page-draft);
388   }
389   > .dropdown-container {
390     display: block;
391   }
392 }
393
394 .icon-list hr {
395   margin: $-s $-m;
396   max-width: 140px;
397   opacity: 0.25;
398   height: 1.1px;
399 }
400
401 .icon-list hr + hr, .icon-list hr:first-child, .icon-list hr:last-child {
402   display: none;
403 }
404
405 .entity-list-item, .icon-list-item {
406   padding: $-s $-m;
407   display: flex;
408   align-items: center;
409   background-color: transparent;
410   border: 0;
411   width: 100%;
412   position: relative;
413   word-break: break-word;
414   h4 a {
415     color: #666;
416   }
417   > span:first-child {
418     margin-inline-end: $-m;
419     flex-basis: 1.88em;
420     flex: none;
421   }
422   > span:last-child {
423     flex: 1;
424     text-align: start;
425   }
426   &:not(.no-hover) {
427     cursor: pointer;
428   }
429   &:not(.no-hover):hover {
430     text-decoration: none;
431     background-color: rgba(0, 0, 0, 0.1);
432     border-radius: 4px;
433   }
434   &.outline-hover {
435     border: 1px solid transparent;
436   }
437   &.outline-hover:hover {
438     background-color: transparent;
439     border-color: rgba(0, 0, 0, 0.1);
440   }
441   &:focus {
442     @include lightDark(background-color, #eee, #222);
443     outline: 1px dotted #666;
444     outline-offset: -2px;
445   }
446 }
447
448 .entity-list-item-path-sep {
449   display: inline-block;
450   vertical-align: top;
451   position: relative;
452   top: 1px;
453   svg {
454     margin-inline-end: 0;
455   }
456 }
457
458 .card .entity-list-item:not(.no-hover):hover {
459   @include lightDark(background-color, #F2F2F2, #2d2d2d)
460 }
461 .card .entity-list-item .entity-list-item:hover {
462   background-color: #EEEEEE;
463 }
464
465 .entity-list-item-children {
466   padding: $-m;
467   > div {
468     overflow: hidden;
469     padding: $-xs 0;
470     margin-top: -$-xs;
471   }
472   .entity-chip {
473     text-overflow: ellipsis;
474     height: 2.5em;
475     overflow: hidden;
476     text-align: start;
477     display: block;
478     white-space: nowrap;
479   }
480 }
481
482 .entity-list-item-image {
483   align-self: stretch;
484   width: 140px;
485   flex: none;
486   background-size: cover;
487   background-position: 50% 50%;
488   border-radius: 3px;
489   position: relative;
490   margin-inline-end: $-l;
491
492   &.entity-list-item-image-wide {
493     width: 220px;
494   }
495
496   .svg-icon {
497     @include lightDark(color, #fff, rgba(255, 255, 255, 0.6));
498     font-size: 1.66rem;
499     margin-inline-end: 0;
500     position: absolute;
501     bottom: $-xs;
502     left: $-xs;
503   }
504
505   @include smaller-than($m) {
506     width: 80px;
507   }
508 }
509
510 .chapter > .entity-list-item-image {
511   width: 60px;
512 }
513
514 .entity-list.compact {
515   font-size: 0.6 * $fs-m;
516   h4, a {
517     line-height: 1.2;
518   }
519   .entity-item-snippet {
520     display: none;
521   }
522   .entity-list-item p {
523     font-size: $fs-m * 0.8;
524     padding-top: $-xs;
525   }
526   p {
527     margin: 0;
528   }
529   > p.empty-text {
530     display: block;
531     font-size: $fs-m;
532   }
533   hr {
534     margin: 0;
535   }
536   @include smaller-than($m) {
537     h4 {
538       font-size: 1.666em;
539     }
540   }
541 }
542
543 .dropdown-container {
544   display: inline-block;
545   vertical-align: top;
546   position: relative;
547 }
548
549 .dropdown-menu {
550   display: none;
551   position: absolute;
552   z-index: 999;
553   top: 0;
554   list-style: none;
555   right: 0;
556   margin: $-m 0;
557   @include lightDark(background-color, #fff, #333);
558   box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.1);
559   border-radius: 1px;
560   border: 1px solid #EEE;
561   @include lightDark(border-color, #eee, #000);
562   min-width: 180px;
563   padding: $-xs 0;
564   @include lightDark(color, #555, #eee);
565   fill: currentColor;
566   text-align: start !important;
567   &.wide {
568     min-width: 220px;
569   }
570   .text-muted {
571     color: #999;
572     fill: #999;
573   }
574   li.active a {
575     font-weight: 600;
576   }
577   a, button {
578     display: block;
579     padding: $-xs $-m;
580     @include lightDark(color, #555, #eee);
581     fill: currentColor;
582     white-space: nowrap;
583     &:hover, &:focus {
584       text-decoration: none;
585       background-color: var(--color-primary-light);
586       color: var(--color-primary);
587     }
588     &:focus {
589       outline: 1px solid var(--color-primary);
590       outline-offset: -2px;
591     }
592     svg {
593       margin-inline-end: $-s;
594       display: inline-block;
595       width: 16px;
596     }
597   }
598   button {
599     width: 100%;
600     text-align: start;
601   }
602   li.border-bottom {
603     border-bottom: 1px solid #DDD;
604   }
605 }
606
607 // Books grid view
608 .featured-image-container {
609   position: relative;
610   overflow: hidden;
611   min-height: 140px;
612   background-size: cover;
613   background-position: 50% 50%;
614   transition: opacity ease-in-out 240ms;
615   a {
616     display: block;
617   }
618   img {
619     display: block;
620     width: 100%;
621     max-width: 100%;
622     height: auto;
623   }
624 }
625 .featured-image-container-wrap {
626   position: relative;
627   .svg-icon {
628     @include lightDark(color, #fff, rgba(255, 255, 255, 0.6));
629     font-size: 2rem;
630     margin-inline-end: 0;
631     position: absolute;
632     bottom: 10px;
633     left: 6px;
634   }
635 }
636 .grid-card:hover .featured-image-container {
637   opacity: .5;
638 }
639
640 .action-link-list {
641   //padding: $-s 0;
642 }
643 .action-link {
644   background: transparent;
645   border: none;
646   color: currentColor;
647   padding: $-m 0;
648 }
649
650 .active-link-list {
651   a {
652     display: inline-block;
653     padding: $-s;
654   }
655   a:not(.active) {
656     @include lightDark(color, #444, #666);
657   }
658   a:hover {
659     @include lightDark(background-color, rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
660     border-radius: 3px;
661     text-decoration: none;
662   }
663 }