in app theme switcher ?! #18158
-
| hello community, should i go similar way as suggested in currently i have no idea.. ;-) and then there needs to be one or two custom ones.. (at least that is my current idea) | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
| I built a solution to manage dynamic themes per client that relies on a combination of Pinia for centralization and Quasar's CSS Variables utilities for application. This approach ensures that business rules and theme state are maintained in a single, accessible location. 1. Centralization with Pinia (Store)I used a dedicated Pinia Store to concentrate: 
 2. Client Schemas and ApplicationI keep all color schemes and visual identities defined per client. The moment a user accesses the system through the client's specific URL, the Pinia Store identifies the client. The application of colors is done instantly using Quasar's  The code snippet for applying the primary color, which respects Quasar's current color mode, is very concise: import { Dark, setCssVar } from 'quasar';
// 'currentBrand' is obtained from the Store after client identification
// 1. Determines which theme object (light or dark) should be used
const themeMode = Dark.isActive ? "dark" : "light"; 
// 2. Applies the dynamic primary color, changing the global CSS variable
setCssVar("primary", currentBrand.value.brand[themeMode].primary);
// This method works very well for any Quasar variable (secondary, accent, etc.). | 
Beta Was this translation helpful? Give feedback.
I built a solution to manage dynamic themes per client that relies on a combination of Pinia for centralization and Quasar's CSS Variables utilities for application.
This approach ensures that business rules and theme state are maintained in a single, accessible location.
1. Centralization with Pinia (Store)
I used a dedicated Pinia Store to concentrate:
currentBrand).2. Client Schemas and Application
I keep all color schemes and visual identities defined per client. The moment a user accesses the system thro…