how to change --bs-table-hover-bg,--bs-table-striped-bg colors.bg colors of rows when mouse hover

how to change --bs-table-hover-bg,--bs-table-striped-bg colors.bg colors of rows when mouse hover

AshaMAshaM Posts: 8Questions: 1Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • AshaMAshaM Posts: 8Questions: 1Answers: 0

    how to --bs-table-striped-bg and --bs-table-hover-bg that is backgroud colors of rows when mouse hover on it and striped colors of row

  • allanallan Posts: 61,786Questions: 1Answers: 10,114 Site admin

    You need to use --dt-row-stripe and --dt-row-hover rather than the Bootstrap specific ones. The reason for that is that I use those variables for more than just striping and hovering - they need to be tinted for the ordering column, row selection, etc, as well.

    Note that those CSS variables use red green blue formatting - note that there is no comma - e.g.:

    table {
      --dt-row-stripe: 255 0 0;
    }
    

    Allan

  • AshaMAshaM Posts: 8Questions: 1Answers: 0

    i want to give colors in variables like var(--color-base)

  • allanallan Posts: 61,786Questions: 1Answers: 10,114 Site admin

    Yes, the two variables I mentioned are the two you need to set.

    Allan

  • AshaMAshaM Posts: 8Questions: 1Answers: 0

    can we set color like table {
    --dt-row-stripe: red;
    } OR table {
    --dt-row-stripe: #801C7D;
    } OR table {
    --dt-row-stripe: var(--color-base-shade7));
    }

  • allanallan Posts: 61,786Questions: 1Answers: 10,114 Site admin
    table {
      --dt-row-stripe: 255 0 0;
    }
    

    Like I showed above.

    Because of the variations it can perform on it for the shading, there is no comma between the rgb values.

    Allan

Sign In or Register to comment.