I’m trying to develop a website on nuxt 3 and there is one feature I want to implement, but I have no idea how best to do it. My goal is to implement multiple designs with the ability to switch designs in the admin interface.
I imagine it like this: the database stores the name of the selected design and the options for choosing a design (I have django+graphql on the backend).
The designs should differ from each other not only in colors. In different designs, the same components can have a different size, color, background, border-radius, etc., which means that all styles can differ, but the logic of all elements will be the same.
Important note – I use SSR.
For styles I use tailwindcss, I also use Nuxt UI, PrimeVue, and I wonder if it is possible to implement this at all using these modules?
The design should change for all users of the site
I can use this gql query to get the name of the design I need:
query getDesignName {
settings {
designName
}
}
For example, I have 3 designs (but I plan to increase their number in the future):
- Simplicity
- Glass morphism
- Cartoon
For a clear example of what I want to implement, let’s assume that the selected design in the database is “Glass Morphism”. In this case, I want my component to look like this photo:
Glass morphism design example
And if the selected design is “Cartoon”, this component should already look like this:
Cartoon design example
I’ve never come across implementing multiple designs before, so I really need some advice/help and would appreciate it if anyone can help me with this.