'media', 'class' and 'selector' — exactly what each emits.

Syntax#

nakshora.config.js
js
export default {
  darkMode: 'class', // 'media' | 'class' | 'selector'
};

Details & defaults#

media follows the OS preference via prefers-color-scheme. class requires a dark class on an ancestor (usually <html>) — pair it with a toggle script and localStorage. selector (3.1+) lets you customize the ancestor selector entirely.

Worked examples#

  • Class + localStorage toggle is the standard SaaS pattern
  • Media is best for content sites with no user preference storage

See the configuration/index|configuration hub for the full option table, and api/theme-resolution|theme resolution for how options merge.