instructlab / ui

Place to hack on UI for InstructLab
Apache License 2.0
15 stars 39 forks source link

PF cleanup: remove hardcoded CSS values #368

Open nicolethoen opened 4 days ago

nicolethoen commented 4 days ago

In custom CSS files, colors should never be hardcoded (some examples of non-recommended practices are here and here.

Alternatively, it'd be better to use PF semantic tokens (this will keep the styles dark theme compatible). I am absolutely happy to help you find the correct semantic tokens. They all live in this css file. Any by default, a semantic token is one with NO number at the end of the token name.

i.e. --pf-t--global--color--brand--100 is NOT a semantic token and should not be used. Instead --pf-t--global--color--brand--default is a semantic token and would be better to use when trying to use the brand color.

Some semantic tokens I think you'll use often based on looking at your code:

It's also easy to identify code that is overriding the PF API's colors incorrectly is to add class="pf-v6-theme-dark" to the html or root element. Anything that does not flip to dark mode correctly is something to investigate.