Commit Graph

8 Commits

Author SHA1 Message Date
Javi Martín
ccbdfb8e78 Allow different hover button colors per tenant 2022-11-20 00:29:12 +01:00
Javi Martín
d0d8f9cc1e Allow different layout backgounds per tenant
We were already doing the same for the main header color; now we also
make it easier to use different top links, subnavigation and footer
colors per tenant.

Just like we do with SCSS variables, we use the brand-secondary color
for the top links when the `--top-links` variable isn't defined.
2022-11-20 00:29:12 +01:00
Javi Martín
af040fcc2b Allow different link colors per tenant
Just like we did with SCSS variables, we use the --anchor-color CSS
variable and, if it isn't defined, we use the --brand CSS variable
instead.
2022-11-20 00:29:12 +01:00
Javi Martín
36a1b2cdc2 Allow different secondary colors per tenant 2022-11-20 00:29:12 +01:00
Javi Martín
91614fa2a9 Allow different main header colors per tenant
Just like we did with SCSS variables, we use the `--main-header` CSS
variable and, if it isn't defined, we use the `--brand` CSS variable
instead.

Note that we're still using the `inverted-selection` mixin based on the
default `$main-header` color, so it's possible that we get the inverted
selection in the main header when using a dark color with `$main-header`
but a light color with `--main-header`, which doesn't make much sense.
Not sure whether there's anything we can do about it.
2022-11-20 00:29:12 +01:00
Javi Martín
fcc63cb436 Allow different brand colors per tenant
Until now, overwriting the styles for a certain tenant was a very
tedious task. For example, if we wanted to use a different brand color
for a tenant, we had to manually overwrite the styles for every element
using that color.

It isn't possible to use different SCSS variables per tenant unless we
generate a different stylesheet per tenant. However, doing so would make
the CSS compilation take way too long on installations with more than a
couple of tenants, and it wouldn't allow to get the colors dynamically
from the database, which we intend to support in the future.

So we're using CSS variables instead. These variables are supported by
97% of the browsers (as of October 2022), and for the other 3% of the
browsers we're using the default colors (SCSS variables) instead.

CSS variables have some limitations: for instance, it isn't possible to
use functions like `lighten`, `darken` or `scale-color` with CSS
variables, so the application might behave in a strange way when we use
these functions.

It also isn't possible to automatically get whether black or white text
makes a better contrast with a certain background color. To overcome
this limitation, we're providing variables ending with `-contrast`. For
instance, since the default `$brand` color is a dark one, when assigning
a light color to `--brand`, we probably want to assign
`--brand-contrast: #{$black}` as well, so the text is still readable.
2022-11-20 00:29:12 +01:00
Javi Martín
081b524e03 Fix .keep file in custom stylesheets.
It was accidentally named `.gitkeep` in commit b549eb444. We use `.keep`
everywhere else.
2021-10-06 14:45:51 +02:00
Javi Martín
b549eb444a Allow several custom stylesheets
So other institutions customizing CONSUL can organize their custom code
as they wish to.

We're also updating the comments in the `custom.scss` file, since it was
referencing files which no longer exist.
2021-06-02 16:15:00 +02:00