-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table): convert to use a grid layout
- Loading branch information
1 parent
f964672
commit a80b3cf
Showing
2 changed files
with
101 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,113 @@ | ||
@use '../../utils/scss/mixins'; | ||
|
||
:host { | ||
display: inline-flex; | ||
flex-direction: column; | ||
} | ||
// :host { | ||
// display: inline-flex; | ||
// flex-direction: column; | ||
// } | ||
|
||
.grid { | ||
display: grid; | ||
|
||
.table { | ||
// grid-template-columns: auto auto auto auto auto; /* Define three equal columns */ | ||
grid-template-columns: repeat(5, max-content); | ||
border-collapse: collapse; | ||
gap: 1px; | ||
} | ||
|
||
.table-header { | ||
background-color: var(--pharos-table-header-color-background, var(--pharos-color-ui-20)); | ||
.grid-caption { | ||
grid-column: 1 / -1; | ||
text-align: center; | ||
} | ||
|
||
.table-header__cell { | ||
border: 1px solid var(--pharos-table-header-color-border, var(--pharos-color-ui-30)); | ||
padding: var(--pharos-spacing-1-x); | ||
.grid-header { | ||
display: contents; /* Allow the header to align with the grid structure */ | ||
font-weight: bold; | ||
background-color: var(--pharos-table-header-color-background, var(--pharos-color-ui-20)); | ||
} | ||
|
||
.table-body__cell { | ||
border: 1px solid var(--pharos-table-body-color-border, var(--pharos-color-ui-30)); | ||
.grid-header__cell { | ||
outline: 1px solid var(--pharos-table-header-color-border, var(--pharos-color-ui-30)); | ||
background-color: var(--pharos-table-header-color-background, var(--pharos-color-ui-20)); | ||
padding: var(--pharos-spacing-1-x); | ||
text-align: center; | ||
} | ||
|
||
.table-sticky-header { | ||
position: sticky; | ||
top: 0; | ||
.grid-body { | ||
display: contents; | ||
} | ||
|
||
.table-sticky-header--is-active { | ||
box-shadow: var(--pharos-elevation-level-2); | ||
.grid-body__cell { | ||
outline: 1px solid var(--pharos-table-body-color-border, var(--pharos-color-ui-30)); | ||
padding: var(--pharos-spacing-1-x); | ||
border-collapse: collapse; | ||
} | ||
|
||
.table-sticky-header__cell--is-active { | ||
border: none; | ||
border-right: 1px solid var(--pharos-table-header-color-border, var(--pharos-color-ui-30)); | ||
.grid-row { | ||
display: contents; | ||
|
||
&:last-child { | ||
border-right: none; | ||
} | ||
} | ||
/* grid-template-columns: subgrid; /* Use subgrid to inherit column structure */ | ||
|
||
.table-controls { | ||
display: flex; | ||
justify-content: space-between; | ||
gap: 10px; | ||
align-items: center; | ||
margin-top: var(--pharos-spacing-one-half-x); | ||
} | ||
|
||
.item-per-page-wrapper { | ||
display: flex; | ||
align-items: center; | ||
column-gap: var(--pharos-spacing-one-half-x); | ||
// .table { | ||
// border-collapse: collapse; | ||
// } | ||
|
||
.item-per-page-selector { | ||
width: 75px; | ||
} | ||
} | ||
// .table-header { | ||
// background-color: var(--pharos-table-header-color-background, var(--pharos-color-ui-20)); | ||
// } | ||
|
||
.pagination { | ||
height: var(--pharos-spacing-one-and-a-half-x); | ||
} | ||
} | ||
// .table-header__cell { | ||
// border: 1px solid var(--pharos-table-header-color-border, var(--pharos-color-ui-30)); | ||
// padding: var(--pharos-spacing-1-x); | ||
// } | ||
|
||
.visually-hidden:not(:focus, :active) { | ||
@include mixins.hidden; | ||
} | ||
// .table-body__cell { | ||
// border: 1px solid var(--pharos-table-body-color-border, var(--pharos-color-ui-30)); | ||
// padding: var(--pharos-spacing-1-x); | ||
// } | ||
|
||
// .table-sticky-header { | ||
// position: sticky; | ||
// top: 0; | ||
// } | ||
|
||
// .table-sticky-header--is-active { | ||
// box-shadow: var(--pharos-elevation-level-2); | ||
// } | ||
|
||
// .table-sticky-header__cell--is-active { | ||
// border: none; | ||
// border-right: 1px solid var(--pharos-table-header-color-border, var(--pharos-color-ui-30)); | ||
|
||
// &:last-child { | ||
// border-right: none; | ||
// } | ||
// } | ||
|
||
// .table-controls { | ||
// display: flex; | ||
// justify-content: space-between; | ||
// align-items: center; | ||
// margin-top: var(--pharos-spacing-one-half-x); | ||
|
||
// .item-per-page-wrapper { | ||
// display: flex; | ||
// align-items: center; | ||
// column-gap: var(--pharos-spacing-one-half-x); | ||
|
||
// .item-per-page-selector { | ||
// width: 75px; | ||
// } | ||
// } | ||
|
||
// .pagination { | ||
// height: var(--pharos-spacing-one-and-a-half-x); | ||
// } | ||
// } | ||
|
||
// .visually-hidden:not(:focus, :active) { | ||
// @include mixins.hidden; | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters