cssOMS/table.scss
2023-05-24 18:09:09 +00:00

234 lines
4.4 KiB
SCSS
Executable File

table.fixed {
table-layout: fixed;
}
table:not([id]) > thead .sort-asc, table:not([id]) > thead .sort-desc {
display: none;
}
table .order-up, table .order-down {
cursor: pointer;
}
table thead input[type=radio] {
padding: 0;
margin: 0;
display: none;
}
table thead i.fa {
color: #888;
}
table input[type=radio]:checked + i {
color: var(--button-colored-background);
}
table input[type=checkbox]:checked + label i {
color: var(--button-colored-background);
}
table .sort-asc, table .sort-desc, table .filter {
padding: 0 2px 0 2px;
cursor: pointer;
}
@for $i from 1 through 10 {
.fixed-#{$i} td:nth-child(#{$i}) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
table.default.sticky {
position: relative;
thead {
th, td {
background: var(--table-head-background);
position: sticky;
top: 0;
z-index: 2;
& > * {
vertical-align : middle;
}
}
}
}
.order-up, .order-down, .remove-form, .update-form, .save-form, .form-action {
color: var(--button-colored-background);
}
table.default {
//border-radius: 4px;
width: 100%;
max-width: 100%;
font-size: 0.9em;
box-sizing: border-box;
overflow-x: auto;
caption {
font-size: 1.5rem;
font-weight: 400;
border-bottom: 1px solid var(--box-border);
background: var(--table-caption-background);
padding: .5rem;
//border-top-left-radius: 4px;
//border-top-right-radius: 4px;
text-align: left;
i {
font-size: .8rem;
}
height: 2.5rem;
}
td {
padding: 3px 10px 3px 10px;
white-space: nowrap;
}
tbody {
tr {
height: 2.5rem;
&:nth-of-type(2n) td {
background: var(--table-row-background);
}
&:nth-of-type(2n+1) td {
background: var(--table-row-background-alt);
}
&:hover td, &:focus td {
background: var(--table-row-background-hover);
}
td, th {
border-bottom: 1px solid #ebedf2;
}
&:last-child td, &:last-child th {
border: none;
}
&:focus, &:hover {
outline: none;
transform: scale(1);
box-shadow: 0 0 5px var(--box-border);
}
}
th {
background: var(--table-head-background);
}
}
thead {
background: var(--table-head-background);
tr {
height: 2.5rem;
}
td {
border-bottom: 1px solid #ebedf2;
}
input[type=radio] {
display: none;
&:checked + label {
color: var(--box-highlight);;
}
}
}
.empty {
text-align: center;
color: #d8d8d8;
}
tfoot {
border: none;
label {
float: left;
}
select {
width: auto;
float: right;
margin: 0;
min-width: 0px;
}
td {
text-align: center;
padding-top: 10px;
}
}
}
table.list {
th {
text-align: left;
padding: 2px 0 2px 0;
}
td {
padding: 2px 5px 2px 5px;
}
}
@media screen and (max-width: 600px) {
table.table {
display: table;
width: 100%;
thead {
display: none;
}
tbody {
tr {
height: auto;
display: block;
margin-bottom: .625em;
}
td {
display: flex;
font-size: .8rem;
height: 2rem;
line-height: 2rem;
text-overflow: ellipsis;
overflow: hidden;
max-width: 100%;
&:before {
content: attr(data-label);
margin-right: 10px;
font-weight: bold;
}
}
}
tfoot {
// if not hidden colspan will cause problems and reduce width based on cospan value
// 1/cospan_val
display: none;
}
}
}
.nobreak {
white-space: nowrap;
}