Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix table double layers and hyphens #7272

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/themes/default/src/components/table-stateful.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
.kol-table-stateful {
&__pagination {
font-family: var(--font-family);
hyphens: var(--hyphens);
line-height: var(--line-height);
word-break: break-word;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/themes/default/src/components/table-stateless.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../mixins/kol-table-stateless-wc';

@include kol-table-stateless-wc;
@layer kol-theme-component {
@include kol-table-stateless-wc;
}
223 changes: 110 additions & 113 deletions packages/themes/default/src/mixins/kol-table-stateless-wc.scss
Original file line number Diff line number Diff line change
@@ -1,153 +1,150 @@
@import './rem';

@mixin kol-table-stateless-wc {
@layer kol-theme-component {
.kol-table {
$root: &;
.kol-table {
$root: &;

font-family: var(--font-family);
line-height: var(--line-height);
word-break: break-word;

overflow-x: auto;
overflow-y: hidden;
padding: rem(8);

&__table,
&__caption {
border-width: 0;
border-bottom-width: calc(var(--border-width) * 2);
border-color: var(--color-primary-variant);
border-style: solid;
}

hyphens: var(--hyphens);
font-family: var(--font-family);
line-height: var(--line-height);
word-break: break-word;
&__table {
width: 100%;
border-spacing: 0;
}

overflow-x: auto;
overflow-y: hidden;
&__caption {
padding: rem(8);
}

&__table,
&__caption {
border-width: 0;
border-bottom-width: calc(var(--border-width) * 2);
border-color: var(--color-primary-variant);
border-style: solid;
}

&__table {
width: 100%;
border-spacing: 0;
}

&__caption {
padding: rem(8);
&__focus-element {
&:focus {
outline-color: var(--color-primary-variant);
outline-offset: rem(2);
outline-style: solid;
outline-width: rem(3);
transition: outline-offset 0.2s linear;
}
}

&__focus-element {
&:focus {
outline-color: var(--color-primary-variant);
outline-offset: rem(2);
outline-style: solid;
outline-width: rem(3);
transition: outline-offset 0.2s linear;
}
&__cell {
padding: rem(8);
&--header {
font-weight: normal;
color: var(--color-primary);
background-color: var(--color-light);
}

&__cell {
padding: rem(8);
&--header {
font-weight: normal;
color: var(--color-primary);
background-color: var(--color-light);
}
&--ascending,
&--descending {
&--ascending,
&--descending {
font-weight: 700;
.kol-button {
font-weight: 700;
.kol-button {
font-weight: 700;
}
}
}
}

&__selection {
display: flex;
gap: rem(8);
grid-template-columns: 1fr auto;
align-items: center;
}
&__selection {
display: flex;
gap: rem(8);
grid-template-columns: 1fr auto;
align-items: center;
}

&__spacer {
display: table-row;
height: rem(24);
}
&__spacer {
display: table-row;
height: rem(24);
}

&__spacer-line {
border-width: 0;
border-color: var(--color-primary-variant);
border-style: solid;
&__spacer-line {
border-width: 0;
border-color: var(--color-primary-variant);
border-style: solid;

&--foot {
border-bottom-width: calc(var(--border-width) * 2);
}
&--foot {
border-bottom-width: calc(var(--border-width) * 2);
}

&--head {
border-top-width: calc(var(--border-width) * 2);
}
&--head {
border-top-width: calc(var(--border-width) * 2);
}
}

&__row {
&--body {
&:nth-child(even) {
background-color: var(--color-mute);
}
&__row {
&--body {
&:nth-child(even) {
background-color: var(--color-mute);
}
}
}

&__selection-input {
&:hover {
border-color: var(--color-primary);
box-shadow: 0 rem(2) rem(8) rem(2) rgba(8, 35, 48, 0.24);
}
&__selection-input {
&:hover {
border-color: var(--color-primary);
box-shadow: 0 rem(2) rem(8) rem(2) rgba(8, 35, 48, 0.24);
}

&:focus {
border-color: var(--color-primary);
outline-color: var(--color-primary-variant);
outline-style: solid;
outline-offset: rem(2);
outline-width: rem(3);
}
&:focus {
border-color: var(--color-primary);
outline-color: var(--color-primary-variant);
outline-style: solid;
outline-offset: rem(2);
outline-width: rem(3);
}

&:focus:hover {
box-shadow: none;
}
&:focus:hover {
box-shadow: none;
}

// CHECKBOX
&--checkbox {
border-color: var(--color-subtle);
border-radius: rem(5);
// CHECKBOX
&--checkbox {
border-color: var(--color-subtle);
border-radius: rem(5);

&:checked {
background-color: var(--color-primary);
border-color: var(--color-primary);
}
&:checked {
background-color: var(--color-primary);
border-color: var(--color-primary);
}
}

// RADIO
&--radio {
display: flex;
border-color: var(--color-subtle);
// RADIO
&--radio {
display: flex;
border-color: var(--color-subtle);

&:checked {
border-color: var(--color-primary);
&:checked {
border-color: var(--color-primary);

&:before {
background-color: var(--color-primary);
}
&:before {
background-color: var(--color-primary);
}
}

@at-root #{$root}__selection--indeterminate & {
background-color: var(--color-primary);
border-color: var(--color-primary);
}
}

&__selection-icon {
color: var(--color-light);
}

.kol-icon:hover ~ &__selection-input--checkbox,
&__selection-input--checkbox:hover {
@at-root #{$root}__selection--indeterminate & {
background-color: var(--color-primary);
border-color: var(--color-primary);
}
}

&__selection-icon {
color: var(--color-light);
}

.kol-icon:hover ~ &__selection-input--checkbox,
&__selection-input--checkbox:hover {
border-color: var(--color-primary);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../mixins/kol-table-stateless-wc';

@include kol-table-stateless-wc;
@layer kol-theme-component {
@include kol-table-stateless-wc;
}
Loading
Loading