nuxt-modules / nuxt-modules/color-mode

Should there be a way to force a color mode in the root of the app?

Open
#263 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
1.2k
Forks
123
Avg merge
3h 57m
Merged PRs (30d)
9

Description

Should it be possible to define the page meta in the app.vue?

The problem:
If I have 90% of pages that I want in dark mode, I should be able to do it by only forcing light mode in the 10%, not forcing dark in the 90%. Does this make sense?

In the docs it says the only way to force a color mode is by using definePageMeta, and preference does not overrides the colorMode that system has.

The solution: (?)

// app.vue
definePageMeta({
  colorMode: 'dark',
})

// forces dark mode to all pages by default. 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the current colorMode handling documented for definePageMeta and how app.vue is treated in Nuxt. Determine whether a root-level default can be supported without changing page-specific overrides, then document the expected precedence and add tests covering root defaults and per-page exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.