Allow defining multiple adpative themes #448
Replies: 2 comments 5 replies
-
Hey, thank you for the idea. I think it's super custom case and most of the users don't need multiple light and dark themes. Nevertheless it's still possible to have such API with the current state. By default set your "default" themes as light and dark. If user want premium dark and light themes simply update themes with new colors: https://www.unistyl.es/v3/guides/theming#update-theme-during-runtime To save this preference keep this info somewhere in the storage and override them on each launch. |
Beta Was this translation helpful? Give feedback.
-
@jpudysz hi, I have a similar use case, but even more complex. Multiple themes each one also defining multiple color schemes beyond just light and dark. For example: Additionally different views might have a scoped theme + scheme combination (e.g show a monochrome or dark block within a light screen) I'm thinking how this could be modeled using the runtime API. If I understand correctly, it is mandatory to give up the adaptive themes in order to enable them via the API at runtime? Naively, there could be different react context providers for themes and schemes taking care of returning a scoped theme plus calling the runtime on each rerender if the context has changed in order to tweak the colors based on some config. Would that be possible? I'm mostly worried of losing the many performance benefits of the library. Do you have any other recommendation or alternative solution? Assuming no adaptive themes, is there something similar to scoped themes, but for color schemes? Thanks |
Beta Was this translation helpful? Give feedback.
-
Feature Request: Support for Multiple Adaptive Themes
I’d like to request a feature for Unistyles to allow defining multiple adaptive themes within the library. This would enable developers to configure theme groups, each containing light and dark variants.
Example configuration:
Beta Was this translation helpful? Give feedback.
All reactions