[Koha-bugs] [Bug 31327] Add color scheme picker to the OPAC

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 2 16:35:59 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31327

--- Comment #7 from David Liddle <david.liddle at wycliff.de> ---
I've was working some more on our own OPAC customizations, and not being a web
developer or design professional, I had cause to look up some aspects of CSS.
It was then that I learned about CSS variables. (See
https://www.w3schools.com/css/css3_variables.asp.) It occurred to me that CSS
variables for colors could make Koha theming really easy.

There *is* a list of such variables listed in the ":root" section of opac.css,
but it seems that none of them are in use. Instead, colors are specified
directly by each rule. If a default color palette was formed for the Koha OPAC,
and the CSS contained something like this:

:root {
--kColor1: #abcdef
--kColor2: #fedcba
--kColor3: #123456
--kColor4: #654321
...
}

AND the CSS rules in opac.css (and others) were edited to *always* refer to
colors by way of variables, then a *basic* theme variation would simply need to
change those variables. The change could come by way of OPACUserCSS, a custom
CSS file, a built-in light/dark mode switcher, or a plugin. Some color variants
can be created programmatically – e.g. lighter or darker, shades or tints – so
they wouldn't have to exist as separate variables. The color-mix() function is
a good example of this. (See
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color-mix.)

As I wrote, I'm not a web pro, so I could be wrong, or there could be a more
efficient way. In some ways, I'm just recording my own thoughts on the matter.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list