Make it so coloring cells, rows or tables, automatically change the colors text to a better contrast. #2898

Closed
opened 2026-02-05 05:39:33 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @Michel-Schrem on GitHub (Jul 11, 2022).

Describe the feature you'd like

The problem

Right now, when you change the color in a table, you sometimes have to change the color of the text aswell, because it's not very readable.

While, in light-mode some text is almost fine, it also contains the same reading issue, just for different colors.
image

So the request is:

When choosing a color for a table, make it so, text color gets automatically changed to a brighter or darker contrast.

Example, for how it should look with the feature implemented.
image

image

Describe the benefits this would bring to existing BookStack users

It would be very time-saving for a user, who works a lot with coloring tables. Having him to check if the text has a good contrast on both light and dark mode is quite a hassle and tedious. It's basically a quality of life feature.

Can the goal of this request already be achieved via other means?

Yes, right now this can be achieved by changing the text manually to a higher or lower contrast. However, there's not really a telling, if it looks good on the other theme mode.

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundemental request

How long have you been using BookStack?

6 months to 1 year

Additional context

I hope the issue is understandable.
Kind regards.

Originally created by @Michel-Schrem on GitHub (Jul 11, 2022). ### Describe the feature you'd like ### The problem Right now, when you change the color in a table, you *sometimes* have to change the color of the text aswell, because it's not very readable. ![](https://user-images.githubusercontent.com/58590851/178223883-8688cd9a-6f6b-410f-9e8c-ef2940358a24.png) While, in light-mode some text is *almost* fine, it also contains the same reading issue, just for different colors. ![image](https://user-images.githubusercontent.com/58590851/178224714-5616b9f1-2129-411a-be6a-d6380a2b4bae.png) ### So the request is: When choosing a color for a table, make it so, text color gets automatically changed to a brighter or darker contrast. Example, for how it should look with the feature implemented. ![image](https://user-images.githubusercontent.com/58590851/178226837-a3f581c8-d7ea-472e-8304-cda2ac70f475.png) ![image](https://user-images.githubusercontent.com/58590851/178233403-64503025-d52e-4064-9acf-774f20ccdd0b.png) ### Describe the benefits this would bring to existing BookStack users It would be very time-saving for a user, who works a lot with coloring tables. Having him to check if the text has a good contrast on both light and dark mode is quite a hassle and tedious. It's basically a quality of life feature. ### Can the goal of this request already be achieved via other means? Yes, right now this can be achieved by changing the text manually to a higher or lower contrast. However, there's not really a telling, if it looks good on the other theme mode. ### Have you searched for an existing open/closed issue? - [x] I have searched for existing issues and none cover my fundemental request ### How long have you been using BookStack? 6 months to 1 year ### Additional context I hope the issue is understandable. Kind regards.
OVERLORD added the 🔨 Feature Request label 2026-02-05 05:39:33 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 25, 2022):

Hi @Michel-Pizza, I can't really think of an automated solution that won't add layered complexity or have the potential for further issues.

I could suggest adding the following to the "Custom HTML Head Content" to provide a much more stable experience in this regard for your usage, by enforcing a consistent base color when row or cell background colors exists:

<style>
table tr[style*="background-color"] td,
table td[style*="background-color"] {
    color: #000;
}
</style>
@ssddanbrown commented on GitHub (Jul 25, 2022): Hi @Michel-Pizza, I can't really think of an automated solution that won't add layered complexity or have the potential for further issues. I could suggest adding the following to the "Custom HTML Head Content" to provide a much more stable experience in this regard for your usage, by enforcing a consistent base color when row or cell background colors exists: ```html <style> table tr[style*="background-color"] td, table td[style*="background-color"] { color: #000; } </style> ```
Author
Owner

@ssddanbrown commented on GitHub (Aug 3, 2022):

Since a potential workaround has been provided above I'll close this off.

@ssddanbrown commented on GitHub (Aug 3, 2022): Since a potential workaround has been provided above I'll close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2898