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 dark mode for Bootstrap 5 #4548

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
updated bootstrap scss files
updated bootstrap scss files to support the use of table-dark.
  • Loading branch information
DastardlySky authored Jul 30, 2024
commit f4cc98241187cdd5e23f2f7a66a250f5c1bb4b7d
121 changes: 107 additions & 14 deletions src/scss/themes/bootstrap/tabulator_bootstrap5.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,6 @@ $table-cell-padding-sm: 5px;

//Bootstrap theming classes

&.thead-dark{
.tabulator-header{
border-color: $borderColor;
background-color: $backgroundColor;
color: $table-color;

.tabulator-col{
border-color: $borderColor;
background-color: $backgroundColor;
color: $table-color;
}
}
}

&.table{
background-color: $backgroundColor;

Expand Down Expand Up @@ -347,6 +333,113 @@ $table-cell-padding-sm: 5px;
}



&.thead-dark{
.tabulator-header{
border-color: $table-dark-border-color;
background-color: $table-dark-bg;
color: $table-dark-color;

.tabulator-col{
border-color: $table-dark-border-color;
background-color: $table-dark-bg;
color: $table-dark-color;
}
}
}

&.table-dark{
background-color: $table-dark-bg;

&:not(.thead-light) .tabulator-header{
border-color: $table-dark-border-color;
background-color: $table-dark-bg;
color: $table-dark-color;

.tabulator-col{
border-color: $table-dark-border-color;
background-color: $table-dark-bg;
color: $table-dark-color;
}
}

.tabulator-tableholder{
color: $table-dark-color;
}


.tabulator-row{
border-color: $table-dark-border-color;
background-color: $table-dark-bg;
color: $table-dark-color;

@media (hover:hover) and (pointer:fine){
&:hover{
background-color: $table-dark-border-color;

.tabulator-cell{
background-color: $table-dark-hover-bg;
}
}
}

&.tabulator-selected{
background-color:$rowSelectedBackground;
}
}

.tabulator-footer{
border-color: $table-dark-border-color !important;

.tabulator-calcs-holder{
border-color: $table-dark-border-color !important;
background:$table-dark-bg !important;

.tabulator-row{
border-color: $table-dark-border-color !important;
background-color: $table-dark-bg !important;
color: $table-dark-color !important;
}
}
}
}

&.table-striped{
&:not(.table-dark){
.tabulator-row{
&.tabulator-row-even{
background-color: $rowAltBackgroundColor;

&.tabulator-selected{
background-color:$rowSelectedBackground;
}

@media (hover:hover) and (pointer:fine){
&.tabulator-selectable:hover{
background-color:$rowHoverBackground;
cursor: pointer;
}

&.tabulator-selected:hover{
background-color:$rowSelectedBackgroundHover;
cursor: pointer;
}
}
}
}
}

&.table-dark{
.tabulator-row{
&:nth-child(even){
.tabulator-cell{
background-color: $table-dark-accent-bg;
}
}
}
}
}

//row colors
.tabulator-tableholder{
.tabulator-table{
Expand Down
7 changes: 7 additions & 0 deletions src/scss/themes/bootstrap/variables5.scss
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,12 @@ $table-color: $body-color !default;
$table-bg: #fff !default;
$table-accent-bg: transparent !default;

$table-dark-bg: $gray-900 !default;
$table-dark-accent-bg: rgba($white, .05) !default;
$table-dark-hover-bg: rgba($white, .075) !default;
$table-dark-border-color: lighten($gray-900, 7.5%) !default;
$table-dark-color: $body-bg !default;

$table-th-font-weight: null !default;

$table-striped-color: $table-color !default;
Expand All @@ -720,6 +726,7 @@ $table-group-separator-color: currentColor !default;
$table-caption-color: $text-muted !default;

$table-bg-scale: -80% !default;

// scss-docs-end table-variables

// scss-docs-start table-loop
Expand Down