-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Config alias theme
to extends
#14329
Comments
I think I would love to see: export default defineNuxtConfig({
theme: 'docus'
}) With a I am not found of the array syntax personally (the module ecosystem proves that the community prefer to level option in the |
Feature flags are for (build time -- same as nuxt config) theme/extends layer customization. Like disabling a module that the layer has or adding page prefix (#13367)
I'm also advocating for explicit key for modules but it can be much straight forward to override them like this instead of more verbose |
This is an excellent idea! :) Also, I really like the idea of being able to overwrite some parts of the extended layer before it gets merged. That would be especially useful for things that are dependent on ordering like modules for instance. |
I took a closer look at the extends feature over the past few days and found that it is currently not possible to switch between the different versions during the runtime, as only a final version of the app is being built. This means for the scenario described here, that a separate version of the app has to be deployed for each "theme". Could we implement switching between themes at runtime? defineNuxtConfig({
extends: [
'./base',
{
path: './themeB',
name: 'theme-b'
},
{
path: './themeC',
name: 'theme-c'
}
]
}) <template>
<NuxtPage extendsName="theme-b" />
</template> This would take themes to the nuxt level 😉. |
Thanks for your feedback and ideas @sawden. Extends (and Theme alias) are built-time features coming with their cons and pros (Pro: not everything is possible to be changed on runtime and tree-shaked build time gives it. Con: Cannot change theme variants at runtime) I think this definitely worth to discuss more about runtime themeing (Now we have |
It is more semantic to have single
theme
for when extending a theme layer. In addition, we can have an object shortcut syntax to provide layer options. (Depends on #24))From:
To:
Q: What about theme configuration? It goes under app namespace as a runtime config: (or better
app/theme.config
file #14330)The text was updated successfully, but these errors were encountered: