AdminLTE/build/scss/_table.scss

156 lines
2.6 KiB
SCSS
Raw Normal View History

//
// Component: Table
//
2015-10-31 22:00:16 +01:00
.table {
&:not(.table-dark) {
color: inherit;
}
// fixed table head
&.table-head-fixed {
thead tr:nth-child(1) th {
background-color: $white;
border-bottom: 0;
box-shadow: inset 0 1px 0 $table-border-color, inset 0 -1px 0 $table-border-color;
position: sticky;
top: 0;
z-index: 10;
}
&.table-dark {
thead tr {
&:nth-child(1) th {
background-color: $table-dark-bg;
box-shadow: inset 0 1px 0 $table-dark-border-color, inset 0 -1px 0 $table-dark-border-color;
}
}
}
2015-10-31 22:00:16 +01:00
}
// no border
&.no-border {
&,
td,
th {
border: 0;
}
2015-10-31 22:00:16 +01:00
}
// .text-center in tables
&.text-center {
&,
td,
th {
text-align: center;
}
2015-10-31 22:00:16 +01:00
}
2018-03-17 18:07:55 +01:00
&.table-valign-middle {
thead > tr > th,
thead > tr > td,
tbody > tr > th,
tbody > tr > td {
vertical-align: middle;
2018-03-17 18:07:55 +01:00
}
}
.card-body.p-0 & {
thead > tr > th,
thead > tr > td,
2020-09-24 11:16:02 +02:00
tfoot > tr > th,
tfoot > tr > td,
tbody > tr > th,
tbody > tr > td {
&:first-of-type {
padding-left: map-get($spacers, 4);
}
&:last-of-type {
padding-right: map-get($spacers, 4);
}
2018-03-17 18:07:55 +01:00
}
2015-10-31 22:00:16 +01:00
}
}
// Expandable Table
2020-06-27 18:58:40 +02:00
.table-hover tbody tr.expandable-body:hover {
background-color: inherit !important;
}
[data-widget="expandable-table"] {
cursor: pointer;
2021-02-27 12:56:00 +01:00
i.expandable-table-caret {
transition: transform $transition-speed linear;
}
&[aria-expanded="true"] {
2021-02-27 12:56:00 +01:00
td i.expandable-table-caret {
// stylelint-disable selector-max-attribute
&[class*="right"] {
transform: rotate(90deg);
}
&[class*="left"] {
transform: rotate(-90deg);
}
// stylelint-enable selector-max-attribute
}
}
2020-06-27 18:58:40 +02:00
}
.expandable-body {
> td {
padding: 0 !important;
width: 100%;
> div,
> p {
padding: $table-cell-padding;
}
}
.table {
width: calc(100% - #{$table-cell-padding});
margin: 0 0 0 $table-cell-padding;
tr:first-child {
td,
th {
border-top: none;
}
}
}
}
2020-09-23 16:08:15 +02:00
@include dark-mode () {
2020-09-23 16:08:15 +02:00
.table-bordered {
&,
td,
th {
border-color: $gray-600;
}
}
.table-hover {
tbody tr:hover {
color: $gray-300;
background-color: lighten($dark, 2.5%);
border-color: $gray-600;
}
}
.table {
thead th {
border-bottom-color: $gray-600;
}
th,
td {
border-top-color: $gray-600;
}
&.table-head-fixed {
thead tr:nth-child(1) th {
background-color: lighten($dark, 5%);
}
}
}
}