How to disable @nuxtjs/color-mode
Best I can tell, @nuxtjs/color-mode is installed as a dependency of Nuxt/UI.
I have been struggling to disable this for some time. I have tried different methods, cleared out Application > Storage in my browser, etc., and no matter what I do, I can't seem to figure out whether this is possible and/or what are the correct entries to
app.config.ts
or nuxt.config.ts
.
If anyone could help that would be incredible!3 Replies
Hi @bobleeswagger8468. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To disable the @nuxtjs/color-mode module when using Nuxt UI, you can follow these steps:
1. In your
nuxt.config.ts
file, you can force a specific color mode preference:
This will set the color mode to 'light' and effectively disable the color mode switching functionality. You can replace 'light' with 'dark' if you prefer a dark mode.
2. If you want to completely remove the color mode functionality from your Nuxt UI components, you can add the hide-color-mode
prop to the components that support it. For example:
3. For components like DashboardSearch, you can use the same approach:
It's important to note that completely removing @nuxtjs/color-mode is not recommended when using Nuxt UI, as it's a dependency of the UI library and is used for styling components. Instead, the best approach is to force a specific color mode as shown above.
If you're still experiencing issues after trying these methods, it might be due to cached values in your browser's local storage. Make sure to clear your browser's local storage for the specific domain you're working on.
Sources:
Nuxt UI Pro - ContentSearch
Nuxt UI Pro - DashboardSearch
Nuxt UI - Installation
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@509602837878276106> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
open source code and delete ll what you not need, you are programmer or lamer.