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