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