Closed Tracer1337 closed 2 years ago
What needs to be done:
2 instead of an dark/light theming system we could maybe consider about multiple and also an extendable theme system like vscode have. My thoughts for the future are:
2.1 an key/value store for user settings on the backend where we store which theme a user prefers which can be overwritten per device on localstorage 2.2 . It would also be cool, if we could somehow select a custom css in the desktop app or mount custom themes into the frontend nginx docker container to select. 2.3 Maybe we could consider about dark/light implementation of each theme
I would say that first a good start is to allow custom themes by just adding a css file into the themes folder (could be mounted into the frontend docker container or an dialog to import for the electron app). Then save the users preference in local storage. If nothing is selected, use the machines default for the default light/dark theme. So you need to:
@noctera or what is your opinion?
I think implementing the basic dark and light theme with an select option is a good start. If you have some time left you can add the functionality to add custom themes to the frontend container.
However I wouldn't just replace the toggle with a select menu. I would outsource this option to the settings page.
I think implementing the basic dark and light theme with an select option is a good start. If you have some time left you can add the functionality to add custom themes to the frontend container.
However I wouldn't just replace the toggle with a select menu. I would outsource this option to the settings page.
We could keep both the switch and the theme-selector.
2.3 Maybe we could consider about dark/light implementation of each theme
How will the FE know, which themes are mounted into the container? My first naive approaches are:
themes.json
file in the mounted directory, which the FE queries and therefore knows which themes existHow will the FE know, which themes are mounted into the container? My first naive approaches are
Read my message carefully. My idea was to set that as config option in the Frontend like the base url.
How should we handle the translations for mounted themes? Fallback to the key of the theme?
Can we somehow include translations if available in the themes file via comments in css at the top of the file?
Maybe the generate config script can extract them and add them to the config object.
Can we somehow include translations if available in the themes file via comments in css at the top of the file?
Maybe the generate config script can extract them and add them to the config object.
I don't think that we need translations at all. Someone who mounts his own themes, knows what they are. So only displaying the key may be enough.
Note to myself: Move default themes into a different directory. That way the mounting doesn't override the default themes.
I don't think that we need translations at all. Someone who mounts his own themes, knows what they are. So only displaying the key may be enough.
Good point.
Can you also add a bg color to the select component?
What about choosing a bit darker color as the primary color?
- Can you also add a bg color to the select component?
- What about choosing a bit darker color as the primary color?
Done and Done:
We should be cautious with using a primary color as the background color for large surfaces. This may look weird with some themes (like the dark-theme now)
What about using a slightly darker color than showed on the other side. I think this variant would work in every theme
Can you please resolve conflicts.
Can you please resolve conflicts.
Done
@luwol03 I think we can merge this
Selects now look like this:
Description
Successor of https://github.com/vocascan/vocascan-frontend/pull/101
Also includes changes from https://github.com/vocascan/vocascan-frontend/pull/110, cause I messed up my git history.
Theme-System through CSS variables. The SCSS variables are references to the css variables now.
Themes are stored in the folder
public/themes
. The current theme is stored in Redux and can be changed through a Redux action. Additional themes can also be mounted into the docker container.Screenshots / GIFs (if appropriate):
Without additional themes:
With additional "amber" theme:
Resolves
frontend/projects/1#card-51929616