|
1 | | -$table-font-size ?= .8rem |
2 | | -$table-highlight-color ?= #f2f2f2 |
3 | | -$table-color ?= $grey-8 |
4 | | -$table-border ?= 1px solid rgba(0, 0, 0, .12) |
| 1 | +$table-stripe-color ?= rgba(0, 0, 0, .07) |
| 2 | +$table-highlight-color ?= rgba(0, 0, 0, .14) |
| 3 | +$table-border ?= 1px solid rgba(0, 0, 0, .12) |
5 | 4 |
|
6 | 5 | table.q-table |
7 | | - position relative |
8 | | - border 0 |
9 | 6 | border-collapse collapse |
10 | | - font-size $table-font-size |
11 | | - background-color white |
12 | | - color $table-color |
| 7 | + border-spacing 0 |
| 8 | + empty-cells show |
| 9 | + table-layout fixed |
13 | 10 |
|
14 | | - &.bordered, &.cell-delimiter |
15 | | - border $table-border |
16 | | - &.cell-delimiter |
| 11 | + thead |
| 12 | + text-align left |
| 13 | + vertical-align bottom |
| 14 | + font-weight 700 |
| 15 | + |
| 16 | + th, td |
| 17 | + &:first-child |
| 18 | + border-left-width 0 |
| 19 | + |
| 20 | + margin 0 |
| 21 | + overflow visible |
| 22 | + padding .5rem .7rem |
| 23 | + |
| 24 | + &.compact |
17 | 25 | th, td |
18 | | - border-right $table-border |
19 | | - &.row-delimiter, &.cell-delimiter |
| 26 | + padding .1rem .3rem |
| 27 | + &.loose |
20 | 28 | th, td |
21 | | - border-bottom $table-border |
22 | | - |
23 | | - &.striped |
24 | | - tbody tr |
25 | | - &:nth-child(odd) |
26 | | - background $table-highlight-color |
27 | | - td |
28 | | - border-radius 0 |
29 | | - th |
30 | | - border-bottom $table-border |
31 | | - border-bottom-width 2px |
| 29 | + padding 1rem |
32 | 30 |
|
33 | | - thead |
34 | | - th |
35 | | - padding 12px 18px |
| 31 | + &.bordered, &.cell-delimiter:not(.responsive):not(.flipped) |
| 32 | + border $table-border |
| 33 | + |
| 34 | + &:not(.responsive):not(.flipped) |
| 35 | + &.horizontal-delimiter, &.cell-delimiter |
| 36 | + th, td |
| 37 | + border-bottom $table-border |
| 38 | + |
| 39 | + &.vertical-delimiter, &.cell-delimiter |
| 40 | + th, td |
| 41 | + border-left $table-border |
| 42 | + &:last-child |
| 43 | + border-right $table-border |
| 44 | + |
| 45 | + &.striped-odd, &.striped |
| 46 | + tbody tr:nth-child(odd) |
| 47 | + background $table-stripe-color |
| 48 | + &.striped-even |
| 49 | + tbody tr:nth-child(even) |
| 50 | + background $table-stripe-color |
| 51 | + |
| 52 | + &.flipped |
| 53 | + display flex |
| 54 | + overflow hidden |
| 55 | + background none |
| 56 | + |
| 57 | + thead |
| 58 | + display flex |
| 59 | + flex-shrink 0 |
| 60 | + min-width min-content |
| 61 | + |
| 62 | + tbody |
| 63 | + display flex |
36 | 64 | position relative |
37 | | - vertical-align bottom |
38 | | - text-overflow ellipsis |
39 | | - font-weight 700 |
40 | | - line-height 24px |
41 | | - letter-spacing 0 |
42 | | - height 48px |
43 | | - font-size 12px |
44 | | - color rgba(0, 0, 0, .54) |
45 | | - &:first-of-type |
46 | | - padding-left 24px |
47 | | - &:last-of-type |
48 | | - padding-right 24px |
49 | | - tbody |
| 65 | + overflow-x auto |
| 66 | + overflow-y hidden |
| 67 | + |
50 | 68 | tr |
51 | | - position relative |
52 | | - height 48px |
53 | | - td |
54 | | - position relative |
55 | | - height 48px |
56 | | - padding 12px 18px |
57 | | - vertical-align middle |
58 | | - &:first-of-type |
59 | | - padding-left 24px |
60 | | - &:last-of-type |
61 | | - padding-right 24px |
| 69 | + display flex |
| 70 | + flex-direction column |
| 71 | + min-width min-content |
| 72 | + flex-shrink 0 |
| 73 | + |
| 74 | + td, th |
| 75 | + display block |
62 | 76 |
|
63 | | - &.compact |
64 | | - th |
65 | | - padding-left 5px |
66 | | - padding-right 5px |
67 | 77 | td |
68 | | - padding 5px |
| 78 | + background-image none !important |
| 79 | + border-left 0 |
| 80 | + |
| 81 | + th:not(:last-child), |
| 82 | + td:not(:last-child) |
| 83 | + border-bottom 0 |
| 84 | + |
| 85 | + &.horizontal-delimiter, &.cell-delimiter |
| 86 | + tr |
| 87 | + border-left $table-border |
| 88 | + border-right $table-border |
| 89 | + |
| 90 | + &.vertical-delimiter, &.cell-delimiter |
| 91 | + th, td |
| 92 | + border-top $table-border |
| 93 | + &:last-child |
| 94 | + border-bottom $table-border |
| 95 | + |
| 96 | + @media (max-width $layout-small-max) |
| 97 | + &.responsive:not(.flipped) |
| 98 | + thead |
| 99 | + display none |
| 100 | + tr, td |
| 101 | + display block |
| 102 | + tr |
| 103 | + position relative |
| 104 | + td:before |
| 105 | + content attr(data-th) |
| 106 | + display block |
| 107 | + text-align left |
| 108 | + font-weight bold |
| 109 | + |
| 110 | + &.horizontal-delimiter |
| 111 | + tr:not(:last-child) |
| 112 | + border-bottom $table-border |
| 113 | + |
| 114 | + &.cell-delimiter |
| 115 | + tr |
| 116 | + border $table-border |
| 117 | + |
| 118 | + &.vertical-delimiter, &.cell-delimiter |
| 119 | + th, td |
| 120 | + border-left $table-border |
| 121 | + border-right $table-border |
69 | 122 |
|
70 | | -body.desktop table.q-table.highlight |
71 | | - tbody tr, th |
72 | | - transition all .28s ease-in |
73 | | - &:hover |
74 | | - background darken($table-highlight-color, 5%) |
| 123 | +body.desktop table.q-table.highlight tbody tr |
| 124 | + transition all .28s ease-in |
| 125 | + &:hover |
| 126 | + background $table-highlight-color |
0 commit comments