blob: d6d5a74cec1dec3ee8a865e26a1de974a86be0fe [file] [log] [blame]
jason westoverd36ac8a2025-11-03 20:58:59 -06001
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07002.table {
Yoshie Muranaka183c2752020-02-12 11:30:49 -08003 position: relative;
suryav972424b377d2025-01-24 15:06:35 +05304 z-index: $zindex-dropdown;
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07005
6 td {
jason westoverd36ac8a2025-11-03 20:58:59 -06007 border-top: 1px solid $gray-300;
8 border-bottom: 1px solid $gray-300;
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07009 &:first-of-type {
jason westoverd36ac8a2025-11-03 20:58:59 -060010 border-inline-start: 1px solid $gray-300;
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070011 }
12 &:last-of-type {
jason westoverd36ac8a2025-11-03 20:58:59 -060013 border-inline-end: 1px solid $gray-300;
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070014 }
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -050015 vertical-align: middle;
SurenNewaredc618a82020-08-17 18:42:20 +053016
17 // Table action buttons
18 .btn-link {
jason westoverd36ac8a2025-11-03 20:58:59 -060019 padding: 0.25rem 0.5rem !important;
SurenNewaredc618a82020-08-17 18:42:20 +053020 display: inline-flex;
21 justify-content: center;
22 align-items: center;
jason westoverd36ac8a2025-11-03 20:58:59 -060023 line-height: 1;
24 .visually-hidden {
25 margin-inline-start: 0.25rem;
26 }
SurenNewaredc618a82020-08-17 18:42:20 +053027 }
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070028 }
29
jason westoverd36ac8a2025-11-03 20:58:59 -060030 // Bootstrap 4 thead-light and Bootstrap 5 table-light classes for specificity
31 .thead-light th,
32 .table-light th {
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -050033 vertical-align: middle;
jason westoverd36ac8a2025-11-03 20:58:59 -060034 border-top: 1px solid $gray-300;
35 border-bottom: 1px solid $gray-300;
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -050036 &:first-of-type {
jason westoverd36ac8a2025-11-03 20:58:59 -060037 border-inline-start: 1px solid $gray-300;
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -050038 }
39 &:last-of-type {
jason westoverd36ac8a2025-11-03 20:58:59 -060040 border-inline-end: 1px solid $gray-300;
Dixsie Wolmersa04d46f2020-10-22 06:34:56 -050041 }
Yoshie Muranaka01da8182020-07-08 15:46:43 -070042 color: theme-color("dark");
Sukanya Pandeyfde429e2020-09-14 20:48:39 +053043 &:focus {
44 outline: none;
45 }
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070046 }
47
Yoshie Muranaka30abccb2020-03-11 12:44:24 -070048 .status-icon svg {
49 width: 1rem;
50 height: auto;
51 }
Yoshie Muranaka183c2752020-02-12 11:30:49 -080052
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070053 .b-table-has-details {
54 td {
55 border-bottom: none;
56 }
jason westoverd36ac8a2025-11-03 20:58:59 -060057 }
58
59 // Show right-pointing chevron when collapsed
60 .table-row-expand .btn.collapsed svg {
61 transform: rotate(-90deg);
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080062 }
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080063
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070064 .b-table-details {
Yoshie Muranaka01da8182020-07-08 15:46:43 -070065 background-color: theme-color("light");
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070066 td {
jason westoverd36ac8a2025-11-03 20:58:59 -060067 padding-inline-start: calc(50px + (#{$table-cell-padding-x} * 2));
68 padding-inline-end: calc(50px + (#{$table-cell-padding-x} * 2));
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070069 }
70 dl {
71 margin: 0;
72 }
73 dt {
jason westoverd36ac8a2025-11-03 20:58:59 -060074 float: inline-start;
75 clear: inline-start;
76 margin-inline-end: calc($spacer / 2);
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070077 }
78 dd {
Dixsie Wolmers25e17a12021-06-25 08:15:05 -050079 line-height: 1.2
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070080 }
81 }
82
83 .table-row-expand {
84 width: 50px;
85 .btn {
86 padding: 0;
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070087 }
88 svg {
Yoshie Muranaka01da8182020-07-08 15:46:43 -070089 fill: theme-color("dark");
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070090 }
Yoshie Muranaka4b0fc1d2020-01-06 07:36:16 -080091 }
Sukanya Pandeyfde429e2020-09-14 20:48:39 +053092 .b-table-sort-icon-left {
93 background-position: left calc(1.5rem / 2) center !important;
jason westoverd36ac8a2025-11-03 20:58:59 -060094 padding-inline-start: calc(1.2rem + 0.65em) !important;
Sukanya Pandeyfde429e2020-09-14 20:48:39 +053095 &:focus {
96 outline: none;
97 box-shadow: inset 0 0 0 2px theme-color('primary') !important;
98 }
99 &:hover {
100 background-color: theme-color-dark('light');
101 }
102 }
Mateusz Gapski1d2da292020-09-10 12:07:45 +0200103}
104
105.b-table-sticky-header td {
106 border-top: none;
107}
108
jason westoverd36ac8a2025-11-03 20:58:59 -0600109// Table stacked style for small screens (< 576px)
110@include media-breakpoint-down(sm) {
SurenNeware5e9c3912020-09-25 15:49:16 +0530111 .b-table-stacked-sm {
jason westoverd36ac8a2025-11-03 20:58:59 -0600112 border: 1px solid $gray-300;
SurenNeware5e9c3912020-09-25 15:49:16 +0530113
114 tr {
115
116 &:not(:first-child) > td[aria-colindex='1'] {
jason westoverd36ac8a2025-11-03 20:58:59 -0600117 border-top: 1px solid $gray-300;
SurenNeware5e9c3912020-09-25 15:49:16 +0530118 padding-top: 0.625rem;
119 }
120
121 &:not(.b-table-empty-row) {
122 position: relative; // Restrict background color to get zebra striping for the row
123
124 &::before,
125 &::after {
126 position: absolute;
127 top: 0;
128 height: 100%;
129 z-index: -1;
130 }
131
132 &:before {
133 content: '';
jason westoverd36ac8a2025-11-03 20:58:59 -0600134 background-color: $gray-200;
SurenNeware5e9c3912020-09-25 15:49:16 +0530135 width: 40%;
jason westoverd36ac8a2025-11-03 20:58:59 -0600136 border-inline-end: 1px solid $gray-300;
SurenNeware5e9c3912020-09-25 15:49:16 +0530137 }
138
139 &:after {
140 content: '';
jason westoverd36ac8a2025-11-03 20:58:59 -0600141 inset-inline-end: 0;
SurenNeware5e9c3912020-09-25 15:49:16 +0530142 width: 60%;
143 }
144
145 &:nth-child(even)::after {
jason westoverd36ac8a2025-11-03 20:58:59 -0600146 background-color: $gray-100; // Zebra striping for the row
SurenNeware5e9c3912020-09-25 15:49:16 +0530147 }
148 }
149
150 td {
151 border: 0;
152 padding: 0.75rem;
jason westoverd36ac8a2025-11-03 20:58:59 -0600153 text-align: start !important;
SurenNeware5e9c3912020-09-25 15:49:16 +0530154
155 &:last-of-type {
jason westoverd36ac8a2025-11-03 20:58:59 -0600156 border-inline-end: 0;
SurenNeware5e9c3912020-09-25 15:49:16 +0530157 }
158 }
159 }
160 }
161
162 .table.b-table.b-table-stacked-sm > tbody > tr > [data-label] {
163 &::before {
jason westoverd36ac8a2025-11-03 20:58:59 -0600164 text-align: start;
165 padding-inline-start: calc($spacer / 2);
SurenNeware5e9c3912020-09-25 15:49:16 +0530166 }
167
168 > div {
jason westoverd36ac8a2025-11-03 20:58:59 -0600169 padding-inline-start: 1rem;
SurenNeware5e9c3912020-09-25 15:49:16 +0530170 }
171 }
172
173 .table.b-table.b-table-stacked-sm > tbody > tr > :first-child {
174 border-top-width: 1px;
175 }
SurenNewaredc618a82020-08-17 18:42:20 +0530176}