summaryrefslogtreecommitdiff
path: root/src/assets/styles/bmc/custom/_tables.scss
blob: 8786ebb5aedef805d388d5d2a8ed14e0f515fb72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
.table {
  position: relative;
  z-index: $zindex-dropdown;
  
  td {
    border-top: 1px solid $gray-10;
    border-bottom: 1px solid $gray-10;
    &:first-of-type {
      border-left: 1px solid $gray-10;
    }
    &:last-of-type {
      border-right: 1px solid $gray-10;
    }
    vertical-align: middle;
    font-size: 0.875rem;
    // Table action buttons
    .btn-link {
      width: 40px;
      height: 40px;
      padding: 5px !important;
      display: inline-flex;
      justify-content: center;
      align-items: center;
    }
  }

  // thead-light added for specificity
  .thead-light th {
    background-color: $gray-10;
    vertical-align: middle;
    border-top: 1px solid $gray-10;
    border-bottom: 1px solid $gray-10;
    &:first-of-type {
      border-left: 1px solid $gray-10;
    }
    &:last-of-type {
      border-right: 1px solid $gray-10;
    }
    text-transform: uppercase;
    color: $text-primary;
    &:focus {
      outline: none;
    }
    & > div {
      font-size: 0.875rem !important;
    }
  }

  .status-icon svg {
    width: 1rem;
    height: auto;
  }

  .b-table-has-details {
    td {
      border-bottom: none;
    }
    .table-row-expand svg {
      transform: rotate(180deg);
    }
  }

  .b-table-details {
    background-color: inherit;
    td {
      padding-left: $table-cell-padding;
      padding-right: $table-cell-padding;
    }
    dl {
      margin: 0;
    }
    dt {
      font-size: 0.75rem !important;
      float: left;
      clear: left;
      margin-right: $spacer / 2;
    }
    dd {
      font-size: 0.75rem !important;
      line-height: 1.2
    }
  }

  .table-row-expand {
    width: 50px;
    .btn {
      padding: 0;
      width: 40px;
    }
    svg {
      fill: theme-color("dark");
    }
  }
  .b-table-sort-icon-left {
    background-position: left calc(1.5rem / 2) center !important;
    padding-left: calc(1.2rem + 0.65em) !important;
    &:focus {
      outline: none;
      box-shadow: inset 0 0 0 2px theme-color('primary') !important;
    }
    &:hover {
      background-color: theme-color-dark('light');
    }
  }
}

.b-table-sticky-header td {
  border-top: none;
}

// Table stacked style for small screen only
@include media-breakpoint-down(xs) {
  .b-table-stacked-sm {
    border: 1px solid $gray-10;

    tr {

      &:not(:first-child) > td[aria-colindex='1'] {        
        border-top: 1px solid $gray-10;
        padding-top: 0.625rem;
      }

      &:not(.b-table-empty-row) {
        position: relative; // Restrict background color to get zebra striping for the row

        &::before,
        &::after {
          position: absolute;
          top: 0;
          height: 100%;
          z-index: -1;
        }

        &:before {
          content: '';
          background-color: gray("200");
          width: 40%;
          border-right: 1px solid gray("300");
        }

        &:after {
          content: '';
          right: 0;
          width: 60%;
        }

        &:nth-child(even)::after {
          background-color: gray("100"); // Zebra striping for the row
        }
      }

      td {
        border: 0;
        padding: 0.75rem;
        text-align: left !important;

        &:last-of-type {
          border-right: 0;
        }
      }
    }
  }

  .table.b-table.b-table-stacked-sm > tbody > tr > [data-label] {
    &::before {
      text-align: left;
      padding-left: $spacer /2;
    }

    > div {
      padding-left: 1rem;
    }
  }
}

.table-responsive, .table-responsive-md {
  margin-top: 0.5rem;

}