Commit Graph

16 Commits

Author SHA1 Message Date
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
e050e5cc70 Remove redundant text color definitions
These elements were already using these colors because they inherited
them from their parent elements or Foundation already defined them.

Note that the only contents of `.comment-info` are: `.user-name` and
`.is-author`, `.is-association`, `.level-1`, ... and the link to the
comment. All of these elements were overwriting the `$text-medium`
color, so there's no need to set it. That means we can use the default
text color for `.user-name` without specifically setting it.
2022-10-27 01:10:31 +02:00
Javi Martín
9dfff1864a Fix hover and current datepicker color
We were using the wrong color since commit e2d540d20 because, by using
`@extend`, the compiled CSS had the styles for `.ui-state-hover` appear
before the styles for `.ui-state-default`.
2022-10-23 18:55:38 +02:00
Javi Martín
8e8a4d784c Simplify using text color for links
Using `inherit` is IMHO more expressive since it means "use the color of
the parent element".

This is particularly useful for CONSUL installations using custom
styles. Consider the following code:

```
h2 {
  color: $white;

  a {
    color: $white;
  }
}
```

If we'd like to customize the way headings look, we'd have to override
two colors:

```
h2 {
  color: $red;

  a {
    color: $red;
  }
}
```

Consider the scenario where we use `inherit`:

```
h2 {
  color: $white;

  a {
    color: inherit;
  }
}
```

Now we only need to override one color to change the styles:

```
h2 {
  color: $red;
}
```
2021-06-29 19:45:09 +02:00
Javi Martín
e2d540d203 Extract code to define brand background
Setting the color to `$white` or `#fff` while setting the background to
`$brand` is a pattern we were using in many places. Since we're going to
edit it in order to fix the `::selection` behavior, we're defining the
pattern in one place.
2021-03-24 15:48:24 +01:00
decabeza
acc7cf65e3 Replace single quotes to double quotes on scss files 2019-02-11 17:42:58 +01:00
decabeza
8535380402 Fixes color of datepicker calendar 2018-10-18 18:15:12 +02:00
decabeza
6642d47f4c fixes scss lint errors 2017-09-20 19:26:43 +02:00
iagirre
b889d23fe6 Fixed width property, changed to top. 2017-09-18 08:19:47 +02:00
iagirre
354d07c1a6 Changes suggested in the PR https://github.com/consul/consul/pull/1869 made. Use the icons of consul instead of icons from jquery-ui.
Cambios para hacer commit:
	modificado:    app/assets/stylesheets/application.scss
	modificado:    app/assets/stylesheets/datepicker_overrides.scss
	borrado:       app/assets/stylesheets/jquery-ui-theme_overrides.scss.erb
2017-09-15 10:02:18 +02:00
iagirre
f1eb535bde The arrows of the datepicker for changing the month didn't appear. There was a link for it, but no icons. The CSS file "theme" from jquery-ui was missing.
Cambios para hacer commit:
	modificado:    app/assets/stylesheets/application.scss
	modificado:    app/assets/stylesheets/datepicker_overrides.scss
	nuevo archivo: app/assets/stylesheets/jquery-ui-theme_overrides.scss.erb
2017-09-14 16:54:49 +02:00
decabeza
76b7f66fb3 fixes scss lint warnings 2017-06-16 12:09:01 +02:00
Alberto Garcia Cabeza
7c65a6ee1a Merge branch 'add_banners_admin' of https://github.com/MaiteHdezRivas/consul into MaiteHdezRivas-add_banners_admin 2016-05-23 12:14:52 +02:00
MaiteHdezRivas
3b2bfc46cf Admin option to add banners and show banners 2016-05-19 13:18:30 +02:00
Alberto Garcia Cabeza
49c8145e76 Cleans scss 2016-05-18 18:39:35 +02:00
Alberto Garcia Cabeza
ffbbdb3358 Adds custom styles for date picker 2016-01-20 15:57:14 +01:00