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

Select for BS5 does not handle table variants #1

Open
large opened this issue Jul 28, 2021 · 2 comments
Open

Select for BS5 does not handle table variants #1

large opened this issue Jul 28, 2021 · 2 comments

Comments

@large
Copy link

large commented Jul 28, 2021

When using BS5 table variants like "table-light", "table-dark" etc select does not draw/coloring as expected.
See example http://live.datatables.net/huhaciwu/1/edit (with and without table variant enable)

Default BS5 sets the --bs-table-bg: transparent, but when you use "table-light" then coloring is --bs-table-bg: #f8f9fa;

Tried to put "!important" behind the coloring of "background-color" in the select.css, without any effect.

Note on variants: https://getbootstrap.com/docs/5.0/content/tables/
This is what happens behind the "scenes".

@mixin table-variant($state, $background) {
  .table-#{$state} {
    $color: color-contrast(opaque($body-bg, $background));
    $hover-bg: mix($color, $background, percentage($table-hover-bg-factor));
    $striped-bg: mix($color, $background, percentage($table-striped-bg-factor));
    $active-bg: mix($color, $background, percentage($table-active-bg-factor));

    --#{$variable-prefix}table-bg: #{$background};
    --#{$variable-prefix}table-striped-bg: #{$striped-bg};
    --#{$variable-prefix}table-striped-color: #{color-contrast($striped-bg)};
    --#{$variable-prefix}table-active-bg: #{$active-bg};
    --#{$variable-prefix}table-active-color: #{color-contrast($active-bg)};
    --#{$variable-prefix}table-hover-bg: #{$hover-bg};
    --#{$variable-prefix}table-hover-color: #{color-contrast($hover-bg)};

    color: $color;
    border-color: mix($color, $background, percentage($table-border-factor));
  }
}
@AllanJard
Copy link
Contributor

Hi - thanks for posting this question. You are right - at the moment we don't take into account Bootstrap 5 table variants and variables yet. It is something I plan to support in future.

@large
Copy link
Author

large commented Jul 28, 2021

Good to know... I saw a simular question here, where you created a fix 😁 https://datatables.net/forums/discussion/68683/datatables-1-10-25-breaks-table-striped

I am no expert in cscc, but I guess the solution are the direction of your fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants