Skip to content

Commit

Permalink
UHF-8509: Initial commit for the table styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
khalima committed Oct 19, 2023
1 parent 52ac1d9 commit 398e499
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 80 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

118 changes: 44 additions & 74 deletions src/scss/04_elements/_table.scss
Original file line number Diff line number Diff line change
@@ -1,86 +1,56 @@
table {
background-color: $color-white;
border: 1px solid $color-black-60;
border-spacing: 0;
display: block;
margin: $spacing-double 0;
max-width: fit-content;
overflow-x: auto;
table-layout: fixed;
white-space: nowrap;
// TODO What to do with these?
figure.table {
margin: 0;
}

// TODO What to do with these?
figure.table figcaption {
@include font('h4');
color: $color-black;
margin-bottom: $spacing;
margin-top: $spacing;

caption {
@include font('body');
background-color: $color-black;
color: $color-white;
padding: $spacing-double $spacing;
text-align: start;
@include breakpoint($breakpoint-l) {
@include font('h3');
}
}

thead {
background-color: $color-black;
table {
@include font('body');
border: 2px solid $color-black-90;
border-spacing: 0;
margin: 0;
padding: 0;
width: auto;

th {
@include font('small');
color: $color-white;
font-weight: $font-weight-medium;
min-width: 140px;
padding: $spacing;
text-align: start;
vertical-align: middle;
white-space: normal;
table:has(tr:nth-child(n+5)) tr:nth-child(even) td {
background: $color-black-5;
}

p {
font-size: inherit;
font-weight: inherit;
margin: 0;
}
td,
th {
border-bottom: 1px solid $color-black-50;
color: $color-black;
min-width: 0;
padding: $spacing-half $spacing;
text-align: left;

@include breakpoint($breakpoint-m) {
// Specs: 12px top and bottom padding.
padding: 12px $spacing-and-half;
}
}

tbody,
tfoot {
background-color: $color-white;
th {
background: $color-black-10;
font-weight: $font-weight-bold;

tr {
background-color: $color-white;

&:hover,
&:active {
background-color: $color-black-5;
}

th,
td {
@include font('small');
color: $hdbt-color-black;
min-width: 140px;
padding: $spacing;
text-align: start;
vertical-align: middle;
white-space: normal;

p {
margin: 0;

& + p {
margin: $spacing 0 0;
}
}
}

th {
background-color: $color-black;
color: $color-white;
font-weight: $font-weight-medium;
}

// Row border-color.
&:not(:last-of-type) {
td {
border-bottom: 1px solid $color-black-10;
}
}
strong {
font-weight: $font-weight-bold;
}
}

td {
background: $color-white;
}
}

0 comments on commit 398e499

Please sign in to comment.