bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Table striped row color setting for included elements - Bootstrap version 5.1.1 vs. 5.1.3

Open ZeEmEs opened this issue 2 years ago • 4 comments

Prerequisites

Describe the issue

Up to version 5.1.1 it was this in the stylesheet

.table-striped > tbody > tr:nth-of-type(odd) { --bs-table-accent-bg: var(--bs-table-striped-bg); color: var(--bs-table-striped-color); }

from 5.1.2 on it is

.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: var(--bs-table-striped-bg); color: var(--bs-table-striped-color); }

Now all child elements get a color. Often enough this color setting overrides the one given to the element. Is there a special reason for the change? Now it's more difficult setting ones own colors for the elements in a table row. And Bootstrap is more opinionated in regard to the color setting in table row.

Btw. same applies to the setting for the .table-hover > tbody > tr:hover vs. .table-hover > tbody > tr:hover > *

Reduced test cases

see description

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

No response

What version of Bootstrap are you using?

5.1.1 vs. 5.1.3

ZeEmEs avatar Oct 10 '21 18:10 ZeEmEs

#34799 seems to be a breaking change.

maciek-szn avatar Oct 14 '21 17:10 maciek-szn

I join the ZeEmEs request.

I use bootstrap within an asp.net project.

This change has prevented me from upgrading from version 5.1.1 to 5.1.2 (5.1.3 at the time of writing this post is not available as a nuget package).

In version 5.1.1 when I use a table of type table-striped I can customize the color of the font used in the headers using the statement:

Now, with this change, it would force me to have to personalize the color of the font used in the table headers, going column by column.

Going through all the code to make this change is really a pain.

fjalexandre avatar Oct 24 '21 11:10 fjalexandre

This was discussed here - https://stackoverflow.com/questions/72757301/applying-text-success-to-a-bootstrap-5-table-row-that-is-striped-has-no-effect/72757379

dippas avatar Jul 11 '22 21:07 dippas

@dippas thanks for linking a stackoverflow that links to this thread...

G2G2G2G avatar Aug 07 '22 00:08 G2G2G2G