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