New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple themes with their colorSchemes (dark/light) #32
Comments
PS: colors: ({ colors }) => ({
...settings.themeColorKeys.reduce((acc, curr) => {
return {
...acc,
[curr]: `rgba(var(--${curr}-rgb), <alpha-value>)`,
[`${curr}-active`]: `rgba(var(--${curr}-active-rgb), <alpha-value>)`,
};
}, {}), well, similarly with all the settings that can be part of the "theme" and "color scheme" The flow of css variables is something like this // Simple usage: color: var(--primary);
// For custom opacity values we use -rgb name
// Example: color: rgba(var(--primary-rgb), 0.3); Now we think in terms of the theming Now in the context of the application. There is a section where we demonstrate the behavior of the component (let's say a button) To achieve this, a provider was created that accepts css modules with variables as keys What is the problem? |
There is a helper function ( I want to make sure I understand correctly what you need. But first, I need to know if you are aware of this function and if it helps. Is this function not working for you? Want colors to be generated automatically via variables? https://github.com/mertasan/tailwindcss-variables#colorvariable https://github.com/supabase/ui/blob/alpha/ui.config.js |
Hi.
I recreated myself approach with theming from react-spectrum
Also, I used tailwind.
So, for this I created
UIProvider
that receivetheme
andcolorScheme
propsexample of content of css module for one of vars files
As result I have
Your plugin helps a lot to generate from config
r g b
variants for all css variabled declared inside config.But how can you implement this idea with your plugin?
Thanks!
The text was updated successfully, but these errors were encountered: