@scania/tegel
Version:
Tegel Design System
136 lines (120 loc) • 3.69 kB
CSS
:host {
display: contents;
}
:host(.tds-table__header-cell) th {
box-sizing: border-box;
font: var(--tds-headline-07);
letter-spacing: var(--tds-headline-07-ls);
text-align: left;
color: var(--tds-table-color);
background-color: var(--tds-table-header-background);
border-bottom: 1px solid var(--tds-table-header-background-hover);
padding: 0;
height: 48px;
min-width: 192px;
box-sizing: border-box;
vertical-align: middle;
overflow: hidden;
transition: background-color 200ms ease;
}
:host(.tds-table__header-cell) th * {
box-sizing: border-box;
}
:host(.tds-table__header-cell) th .tds-table__header-text {
padding: 8px 16px;
margin: 0;
}
:host(.tds-table__header-cell) th .tds-table__header-text-no-padding {
padding: 0;
}
:host(.tds-table__header-cell) th:hover {
background-color: var(--tds-table-header-background-hover);
}
:host(.tds-table__header-cell--sortable) th .tds-table__header-button {
display: flex;
align-items: center;
gap: 8px;
justify-content: start;
flex-direction: row;
width: 100%;
height: 100%;
padding: 0 16px;
background-color: transparent;
border: none;
cursor: pointer;
transition: background-color 200ms ease;
}
:host(.tds-table__header-cell--sortable) th .tds-table__header-button:focus {
outline: 2px solid var(--tds-table-header-btn-focus);
outline-offset: -2px;
}
:host(.tds-table__header-cell--sortable) th .tds-table__header-button:focus .tds-table__header-button-icon {
opacity: 1;
}
:host(.tds-table__header-cell--sortable) th .tds-table__header-button .tds-table__header-button-text {
font: var(--tds-headline-07);
letter-spacing: var(--tds-headline-07-ls);
text-align: left;
color: var(--tds-table-header-btn-color);
}
:host(.tds-table__header-cell--sortable) th .tds-table__header-button .tds-table__header-button-icon {
/* not to shrink on lot of text */
flex: 0 0 16px;
height: 16px;
width: 16px;
opacity: 0;
transform-origin: center;
transition: opacity 200ms ease-in, transform 200ms ease;
color: var(--tds-table-color);
}
:host(.tds-table__header-cell--sortable) th .tds-table__header-button:hover .tds-table__header-button-icon {
opacity: 1;
}
:host(.tds-table__header-cell--is-sorted) th .tds-table__header-button {
background-color: var(--tds-table-header-btn-background);
}
:host(.tds-table__header-cell--is-sorted) th .tds-table__header-button:hover {
background-color: var(--tds-table-header-btn-background-hover);
}
:host(.tds-table__header-cell--is-sorted) th .tds-table__header-button .tds-table__header-button-icon {
opacity: 1;
}
:host(.tds-table__header-cell--is-sorted) th .tds-table__header-button .tds-table__header-button-icon--rotate {
transform: rotate(180deg);
}
:host(.tds-table--compact) th {
height: 33px;
}
:host(.tds-table--divider) th {
border-right: 1px solid var(--tds-table-divider);
}
:host(.tds-table--divider:last-of-type) th {
border-right: none;
}
:host(.tds-table--no-min-width) th {
min-width: unset;
}
:host(.tds-table--no-padding) th {
height: unset;
}
:host(.tds-table__header-cell:first-of-type) th {
border-top-left-radius: 4px;
}
:host(.tds-table__header-cell:last-of-type) th {
border-top-right-radius: 4px;
}
:host(.tds-table--extra-column:first-of-type) th {
border-top-left-radius: 0;
}
:host(.tds-table--toolbar-available) th {
border-radius: 0;
}
:host(.tds-table--extra-column.tds-table--toolbar-available) th {
border-radius: 0;
}
:host(.tds-table__header-cell.tds-table--toolbar-available:first-of-type) th {
border-top-left-radius: 0;
}
:host(.tds-table__header-cell.tds-table--toolbar-available:last-of-type) th {
border-top-right-radius: 0;
}