responsive-table-fluxbox/scss/styles3.scss

90 lines
2.1 KiB
SCSS
Raw Normal View History

2021-05-20 20:10:03 +00:00
$even-color: #dedede;
$thead-color: #dedede;
2021-05-17 07:26:09 +00:00
div.table {
display: flex;
flex-direction: column;
2021-05-20 20:10:03 +00:00
margin-bottom: 5em;
div.tr:nth-child(even) {
background: $even-color;
}
div.thead div.tr {
border-top: 1px solid grey;
background: $thead-color;
div.td {
justify-content: center;
font-weight: bold;
}
}
2021-05-17 07:26:09 +00:00
div.tr {
display: flex;
min-height: 50px;
div.td {
display: flex;
flex: 4;
2021-05-20 20:10:03 +00:00
align-items: center;
padding: 5px;
box-sizing: border-box;
2021-05-17 07:26:09 +00:00
border: 1px solid grey;
border-top: 0;
border-left: 0;
&:nth-child(1) {
border-left: 1px solid grey;
}
2021-05-20 20:42:52 +00:00
&:nth-child(1) { flex: 1; }
2021-05-17 07:26:09 +00:00
&:nth-child(2) { flex: 4; }
&:nth-child(3) { flex: 6; }
&:nth-child(4) { flex: 2; }
&:last-child { flex: 2; }
}
}
}
@media only screen
2021-05-20 20:10:03 +00:00
and (max-width: 800px) {
2021-05-17 07:26:09 +00:00
div.table {
margin-right: 0.5em;
2021-05-20 20:10:03 +00:00
div.thead div.tr {
position: absolute;
top: -9999px;
left: -9999px;
}
div.tbody div.tr:nth-child(1) div.td:nth-child(1) {
border-top: 1px solid grey;
}
2021-05-17 07:26:09 +00:00
div.tr {
flex-direction: column;
2021-05-20 20:10:03 +00:00
padding-left: 37%;
2021-05-17 07:26:09 +00:00
div.td {
position: relative;
border-left: 1px solid grey;
2021-05-20 20:10:03 +00:00
& > div.head {
2021-05-17 07:26:09 +00:00
position: absolute;
top: 0;
left: -57%;
width: 52%;
padding-right: 10px;
white-space: nowrap;
}
}
}
}
@media only screen
and (max-width: 450px) {
div.table {
2021-05-20 20:10:03 +00:00
div.tbody div.tr:nth-child(1) div.td:nth-child(1) {
border-top: 1px solid grey;
}
2021-05-17 07:26:09 +00:00
div.tr {
padding-left: 0;
div.td {
padding-left: 1.5em;
2021-05-20 20:10:03 +00:00
&.head {
2021-05-17 07:26:09 +00:00
font-weight: bold;
padding-left: 0.5em;
}
}
}
}
}
}