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

Avoid hard-coded (text) colors #10014

Closed
tvkit opened this issue Jul 9, 2021 · 1 comment
Closed

Avoid hard-coded (text) colors #10014

tvkit opened this issue Jul 9, 2021 · 1 comment

Comments

@tvkit
Copy link

tvkit commented Jul 9, 2021

Is your feature request related to a problem? Please describe.
Unable to uniformly change text color in default "light" theme

Describe the solution you'd like
Use css vars instead of hard-coded color values within all Quasar components

Describe alternatives you've considered
Currently setting preferred color locally via class/style attributes

Additional context
Generally, the documented .body--light class is working well

.body--light {
  color: var(--light-text);
  background-color: var(--light-background);
}

Here's an example of a hard-coded text color within the QTable component

@rstoenescu
Copy link
Member

Hi,

Those are the "default" colors, cause we actually need some colors, whatever they may be. When Dark mode is applied, it has some other default ones to match it.

However, when other colors are needed or customizing like you do, the developers should use class/style attributes and apply their necessary classes/style.

When it comes to "why don't we use .body--light/dark selectors" for these colors, then the answer is simple. If we use a more complex selector (.body--light .q-table__card) then it's harder to override the colors (you need an equivalent CSS rule instead of directly targeting .q-table__card). Furthermore, "bg-" and "text-" will stop working because their selectors are less specific than the .body--light ... ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants