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.
100 lines
1.4 KiB
SCSS
100 lines
1.4 KiB
SCSS
// Overrides styles of jquery-ui/datepicker
|
|
//
|
|
|
|
.ui-datepicker-header {
|
|
@extend %brand-background;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.ui-datepicker-calendar {
|
|
|
|
.ui-state-hover,
|
|
.ui-state-active {
|
|
@extend %brand-background;
|
|
|
|
.ui-state-default:not(&) {
|
|
background: $highlight;
|
|
}
|
|
}
|
|
|
|
thead {
|
|
|
|
tr th {
|
|
@include brand-border;
|
|
}
|
|
}
|
|
}
|
|
|
|
.ui-datepicker {
|
|
padding: 0;
|
|
z-index: 4 !important;
|
|
|
|
.ui-datepicker-prev,
|
|
.ui-datepicker-next {
|
|
color: inherit;
|
|
cursor: pointer;
|
|
font-family: "icons" !important;
|
|
font-size: rem-calc(24);
|
|
font-weight: normal;
|
|
height: rem-calc(30);
|
|
line-height: $line-height;
|
|
position: absolute;
|
|
top: 4px;
|
|
width: rem-calc(30);
|
|
|
|
&:hover {
|
|
text-decoration: none;
|
|
}
|
|
}
|
|
|
|
.ui-datepicker-prev::after {
|
|
content: "\62";
|
|
}
|
|
|
|
.ui-datepicker-next::after {
|
|
content: "\63";
|
|
}
|
|
|
|
table {
|
|
border: 1px solid $border;
|
|
border-top: 0;
|
|
}
|
|
|
|
tr {
|
|
border-bottom: 1px solid $border;
|
|
|
|
&:last-child {
|
|
border-bottom: 0;
|
|
}
|
|
|
|
&:nth-child(odd) {
|
|
background: none;
|
|
}
|
|
}
|
|
|
|
td {
|
|
padding: 0;
|
|
border-right: 1px solid $border;
|
|
|
|
&:last-child {
|
|
border-right: 0;
|
|
}
|
|
|
|
span,
|
|
a {
|
|
text-align: center;
|
|
line-height: $line-height;
|
|
color: inherit;
|
|
}
|
|
}
|
|
}
|
|
|
|
.ui-datepicker-unselectable.ui-state-disabled {
|
|
background: #fff;
|
|
|
|
.ui-state-default {
|
|
background: #f8f8f8;
|
|
color: $text-medium;
|
|
}
|
|
}
|