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

The color of the tables' body should be set #157

Open
shrektan opened this issue Mar 18, 2020 · 5 comments
Open

The color of the tables' body should be set #157

shrektan opened this issue Mar 18, 2020 · 5 comments

Comments

@shrektan
Copy link

Hi,

First of all, I'm using the default theme as an example. It should apply to other themes as well.

Now the default theme of datatables sets the "background-color" to "white", but not the "color" of the table. It causes an issue that the users will see a blank table when the color of the whole page is set to "white" (for example, in a dark theme).

In addition, from the below screenshot we can know that all other font elements of the table are using #333 as the font color. The only exception is the table body. I don't know if there's any special reason for doing that.

So my suggestion is that datatables should set the color to "#333" explicitly.

Thanks.

(This issue is originally discussed at rstudio/DT#767 , if you are interested)

When we set the color of the page to white, the content of the table is missing

image

@DataTables
Copy link
Collaborator

I actually disagree with this one I'm afraid. My feeling is that DataTables should inherit whatever the body text colour is - that way it will work automatically if you are using it with a dark themed site or with a light themed site.

If you need to change it for your site a single line of CSS would be all is needed.

Ideally the DataTables stylesheet should be defining as little "theme" styling as possible.

@shrektan
Copy link
Author

shrektan commented Mar 18, 2020

@DataTables Yes, it should inherit the body text, I agree with you.

However, why the background of the table is not inheritable? The font color of the buttons is not inheritable, either.

I mean it's inconsistent.

In a dark theme, the background of the table doesn't inherit from the parent DOM but the font color does. It results in a table with a white background (because it's hardcoded, but I expect it inherit from the parent and to be "dark") and white font color (inherited).

So in a dark theme we can see that all other elements are actually hard-coded but only the font color of the body

@DataTables
Copy link
Collaborator

Ah I'm with you now - this example demonstrates it nicely: http://live.datatables.net/hedekori/1/edit .

I agree - DataTables' row styling should be using rgba only. I will be updating that in the v2 branch.

@shrektan
Copy link
Author

Great! Thanks.

So should we leave this issue open or closed?

@DataTables DataTables reopened this Mar 18, 2020
@DataTables
Copy link
Collaborator

Makes sense to leave it open since it is unresolved atm. Thanks!

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

1 participant