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

[TECHDEBT] Dark/Light color handling should be implemented in CSS only #388

Open
jaakristioja opened this issue May 14, 2022 · 0 comments
Open

Comments

@jaakristioja
Copy link
Member

Summary

For changing between light/dark modes of display texts, each display template has an associated colormap (*.cmap) file in INI format to specify colors for both modes and the CSS file has #PLACEHOLDER# for these colors which are replaced using a separate call to ColorManager::replaceColors() wherever rendering is required.

Consequences

This is useless complexity which makes things difficult for developers and theme designers, because this color map technology must be learnt.

Remediation approach

The colormap files must go, and all the light/dark color logic must be embedded in pure CSS files. One way to do that is to just add a light or dark class to the respective <body> element, and let CSS do the rest of the work.

Notes

After the colormap files were introduced, the color values therein got used for other slightly different purposes as well, but due to the flexibility of CSS we can hopefully expand the use of display templates to those places as well.

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

No branches or pull requests

1 participant