Config alias `theme` to `extends`
See original GitHub issueIt 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:
export default defineNuxtConfig({
extends: 'docus',
// https://github.com/unjs/c12/issues/9
extends: { from: 'docus', override: { featureFlag: true } }
}
To:
export default defineNuxtConfig({
theme: 'docus',
theme: [docus, { featureFlag: true }]
}
Q: What about theme configuration? It goes under app namespace as a runtime config: (or better app/theme.config
file https://github.com/nuxt/framework/issues/5918)
export default defineNuxtConfig({
app: {
theme: { }
}
}
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Circular definition of import alias 'theme' - Stack Overflow
I am trying to extend the theme of a third party private npm module. The project compiles successfully but I keep getting a...
Read more >Module Resolution or Import Alias: The Final Guide - Raul Melo
Tired to have weird imports? It's time to learn how can you enable aliases to your imports and let code more organized.
Read more >Extending - VuePress 2
Default theme has registered alias for every non-global components open in new window with a @theme prefix. For example, the alias of HomeFooter ......
Read more >Customizing Colors - Tailwind CSS
Aliasing color names. You can also alias the colors in our default palette to make the names simpler and easier to remember: tailwind.config....
Read more >Extend a theme - Product Documentation | ServiceNow
After extending a theme, you can then override inherited styles from the main theme by setting more specific styles in the extended theme...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
app.config
could enable this too!)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? My suggestion would be to add a theme switch to the
<NuxtPage />
component.This would take themes to the nuxt level 😉. I open to any feedback and would try to implement the feature if desired.