node-vision / strapi-plugin-entity-relationship-chart

Strapi Plugin displays Entity Relationship Diagram of all models, fields and relations.
180 stars 24 forks source link

[BUG] Option labels in black in Dark Theme #18

Open SalahAdDin opened 2 years ago

SalahAdDin commented 2 years ago

Hello,

Thank you very much for this plugin, it is pretty cool for showing it to clients.

But we have a problem with it:

Screen Shot 2022-08-08 at 02 20 10

As you can see, in the dark theme, we can see the options, cause they are still in black.

How can we solve it?

Thank you!

ShahriarKh commented 1 year ago

The label's should have a color based on the current theme:

https://github.com/node-vision/strapi-plugin-entity-relationship-chart/blob/337686ee92b3d8a9b00ee393fe69a086414bb143/admin/src/pages/HomePage/index.js#L142-L153

SalahAdDin commented 1 year ago

The label's should have a color based on the current theme:

https://github.com/node-vision/strapi-plugin-entity-relationship-chart/blob/337686ee92b3d8a9b00ee393fe69a086414bb143/admin/src/pages/HomePage/index.js#L142-L153

It should, but it is not working, it seems this feature was not fully implemented.

ShahriarKh commented 1 year ago

Yeah I know. I meant that the label needs a dynamic color value; something like <label style="color: var(--color-based-on-current-theme)" >. However, I can't seem to find a way to get the current theme, and Strapi itself doesn't use css variables for this.

ShahriarKh commented 1 year ago

I checked other plugins sources, and they were using Strapi design system (https://design-system.strapi.io/) for components, so the colors and design matched the admin area perfectly.

SalahAdDin commented 1 year ago

It seems this plugin requires full refactoring.

ShahriarKh commented 1 year ago

I checked other plugins sources, and they were using Strapi design system (https://design-system.strapi.io/) for components, so the colors and design matched the admin area perfectly.

https://design-system-git-main-strapijs.vercel.app/?path=/story/design-system-components-checkbox--base

import { Checkbox } from "@strapi/design-system";
<Checkbox
    checked={relations}
    onValueChange={(e) => setRelations(e.target.checked)}
>
    relations
    <Legend color="#ff6400" /> 
</Checkbox>
SalahAdDin commented 1 year ago

I checked other plugin sources, and they were using the Strapi design system (https://design-system.strapi.io/) for components, so the colors and design matched the admin area perfectly.

https://design-system-git-main-strapijs.vercel.app/?path=/story/design-system-components-checkbox--base

import { Checkbox } from "@strapi/design-system";
<Checkbox
    checked={relations}
    onValueChange={(e) => setRelations(e.target.checked)}
>
    relations
    <Legend color="#ff6400" /> 
</Checkbox>

Could you make a pull request?