Description
Colorblind variants of the forgejo themes were introduced in forgejo/forgejo#1746 and forgejo/forgejo#6059.
As there are 2 types of colorblindness to account for (Deuteranopia/Protanopia for red & green colors, Tritanopia for blue & yellow colors), each theme requires 2 variants. In addition, a theme was needed for each light, dark and auto theme, resulting in 6 new selections in total.
This poses two problems:
- There are too many themes to select from due to the
*-auto-* themes
- It isn't preferred to implement colorblind variants of other themes (e.g.
gitea-*) to not clutter the UI/UX further for users that don't need these themes.
After a long discussion that can be found in forgejo/forgejo#1746, some solutions were proposed. Please add any other possible/feasible solutions you can think of below as we are brainstorming together.
Suggested Solutions
Allow user to set preferred light/dark theme separately
Allowing the user to set each theme independently of the other would remove the need for all *-auto-* themes, significantly reducing the number of options presented to the user.
Pros:
- This is a popular feature request that will benefit users in general, regardless of need for colorblind themes
Cons:
- Four selections/variants still have to be added for each theme manually
Configuring colorblind variants using accessibility add-ons
@Daniel proposed the following:
A potential solution for the combinatoric explosion of themes could be to allow configuring a base theme and an add-on theme, which is just a CSS file that is included after the base theme CSS. Then we could have the normal forgejo-[light|dark|auto] and gitea-[light|dark|auto] themes as base themes, and the following addon themes:
- None (default)
- light-deuteranopia-protanopia
- light-tritanopia
- dark-deuteranopia-protanopia
- dark-tritanopia
And each add-on themes would look like the following
:root {
--color-diff-removed-word-bg: #c8c850;
--color-diff-removed-row-border: #c8c850;
--color-diff-removed-row-bg: #ffecc4;
--color-diff-added-word-bg: #b8c0ff;
--color-diff-added-row-border: #b8c0ff;
--color-diff-added-row-bg: #e0e0ff;
--color-code-bg: #ffffff;
}
Pros:
- This could be presented via a nice UX to users, presenting an option under the themes section to "Adjust theme for colorblindness" and choosing one of two options:
- deuteranopia-protanopia
- tritanopia
This would not clutter the UI for users that don't need these themes, as well as allowing colorblind users to quickly change between themes without worrying of having to select the right variant
- This would technically work for any and all themes in general, including any themes that forks ship.
- @fnetX: What about [using this as] "accessible theme add-ons", [...] it would allow adding CSS snippets that do different things, such as "High contrast", "more spacing" etc.
Cons:
- Uncertainty of the technical complexity needed to achieve this
- A rather major change to the platform in general
## Description
Colorblind variants of the forgejo themes were introduced in https://codeberg.org/forgejo/forgejo/pulls/1746 and https://codeberg.org/forgejo/forgejo/pulls/6059.
As there are 2 types of colorblindness to account for (Deuteranopia/Protanopia for red & green colors, Tritanopia for blue & yellow colors), each theme requires 2 variants. In addition, a theme was needed for each `light`, `dark` and `auto` theme, resulting in 6 new selections in total.
This poses two problems:
1. There are too many themes to select from due to the `*-auto-*` themes
2. It isn't preferred to implement colorblind variants of other themes (e.g. `gitea-*`) to not clutter the UI/UX further for users that don't need these themes.
After a long discussion that can be found in https://codeberg.org/forgejo/forgejo/pulls/1746, some solutions were proposed. Please add any other possible/feasible solutions you can think of below as we are brainstorming together.
## Suggested Solutions
### Allow user to set preferred light/dark theme separately
Allowing the user to set each theme independently of the other would remove the need for all `*-auto-*` themes, significantly reducing the number of options presented to the user.
Pros:
1. This is a popular feature request that will benefit users in general, regardless of need for colorblind themes
Cons:
1. Four selections/variants still have to be added for each theme manually
### Configuring colorblind variants using accessibility add-ons
[@Daniel](https://codeberg.org/DanielGibson) proposed the following:
> A potential solution for the combinatoric explosion of themes could be to allow configuring a base theme and an add-on theme, which is just a CSS file that is included after the base theme CSS. Then we could have the normal forgejo-[light|dark|auto] and gitea-[light|dark|auto] themes as base themes, and the following addon themes:
- None (default)
- light-deuteranopia-protanopia
- light-tritanopia
- dark-deuteranopia-protanopia
- dark-tritanopia
And each add-on themes would look like the following
```css
:root {
--color-diff-removed-word-bg: #c8c850;
--color-diff-removed-row-border: #c8c850;
--color-diff-removed-row-bg: #ffecc4;
--color-diff-added-word-bg: #b8c0ff;
--color-diff-added-row-border: #b8c0ff;
--color-diff-added-row-bg: #e0e0ff;
--color-code-bg: #ffffff;
}
```
Pros:
1. This could be presented via a nice UX to users, presenting an option under the themes section to "Adjust theme for colorblindness" and choosing one of two options:
- deuteranopia-protanopia
- tritanopia
This would not clutter the UI for users that don't need these themes, as well as allowing colorblind users to quickly change between themes without worrying of having to select the right variant
2. This would technically work for any and all themes in general, including any themes that forks ship.
3. @fnetX: What about [using this as] "accessible theme add-ons", [...] it would allow adding CSS snippets that do different things, such as "High contrast", "more spacing" etc.
Cons:
1. Uncertainty of the technical complexity needed to achieve this
2. A rather major change to the platform in general