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