atst/styles/elements/_tables.scss
2018-10-03 13:58:40 -04:00

112 lines
1.6 KiB
SCSS

/*
* Tables
* @see https://designsystem.digital.gov/components/tables/
* @source https://github.com/uswds/uswds/blob/develop/src/stylesheets/elements/_table.scss
*/
table {
@include panel-margin;
min-width: 100%;
@include ie-only {
border-collapse: separate;
}
th, td {
&.table-cell--align-right {
text-align: right;
}
&.table-cell--shrink {
width: 1%;
}
&.table-cell--expand {
width: 100%;
}
&.table-cell--hide-small {
display: none;
@include media($medium-screen) {
display: table-cell;
}
}
}
tbody {
tr {
th,
td {
@include block-list-item;
display: table-cell;
white-space: nowrap;
border-bottom-style: dashed;
border-top: none;
&:last-child {
border-bottom-style: dashed;
}
}
&:last-child {
td,
th {
border-bottom-style: solid;
}
}
}
}
thead {
tr {
th, td {
@include block-list-header;
display: table-cell;
}
}
}
@at-root .panel #{&} {
tr:last-child td {
border-bottom: 0;
}
&:last-child {
margin-bottom: 0;
}
}
}
.responsive-table-wrapper {
overflow-x: auto;
@include panel-margin;
table {
margin-bottom: 0;
}
@at-root .panel #{&} {
tr:last-child td {
border-bottom: 0;
}
&:last-child {
margin-bottom: 0;
}
}
}
.fixed-table-wrapper {
width: 100%;
table {
max-width: 100%;
table-layout:fixed;
th, td {
white-space: normal;
}
}
}