I have an error to activate the dark theme from the example:
theme.scss:
// @nebular theming framework
@import '~@nebular/theme/styles/theming';
// @nebular out of the box themes
@import '~@nebular/theme/styles/themes';
// which themes you what to enable (empty to enable all)
$nb-enabled-themes: (default, cosmic);
$nb-themes: nb-register-theme((
// app wise variables for each theme
sidebar-header-gap: 2rem,
sidebar-header-height: initial,
layout-content-width: 1400px,
font-main: Roboto,
font-secondary: Exo,
), default, default);
$nb-themes: nb-register-theme((
// app wise variables for each theme
sidebar-header-gap: 2rem,
sidebar-header-height: initial,
layout-content-width: 1400px,
font-main: Roboto,
font-secondary: Exo,
), cosmic, cosmic);
// dark theme
$nb-themes: nb-register-theme((
// app wise variables for each theme
sidebar-header-gap: 2rem,
sidebar-header-height: initial,
layout-content-width: 1400px,
font-main: Roboto,
font-secondary: Exo,
color-bg: black,
color-fg: gray,
), dark, cosmic);
them_switcher line 46, to change the themes:
return theme ? 'cosmic' : 'dark';
Error:
ThemeSwitcherComponent.html:5 ERROR Error: NbThemeConfig: no theme 'dark' found registered.
at NbJSThemesRegistry.webpackJsonp.../../../../@nebular/theme/services/js-themes-registry.service.js.NbJSThemesRegistry.get (js-themes-registry.service.js:68)
at MapSubscriber.project (theme.service.js:71)
at MapSubscriber.webpackJsonp.../../../../rxjs/_esm5/operators/map.js.MapSubscriber._next (map.js:79)
at MapSubscriber.webpackJsonp.../../../../rxjs/_esm5/Subscriber.js.Subscriber.next (Subscriber.js:91)
at RefCountSubscriber.webpackJsonp.../../../../rxjs/_esm5/Subscriber.js.Subscriber._next (Subscriber.js:127)
at RefCountSubscriber.webpackJsonp.../../../../rxjs/_esm5/Subscriber.js.Subscriber.next (Subscriber.js:91)
at Subject.webpackJsonp.../../../../rxjs/_esm5/Subject.js.Subject.next (Subject.js:56)
at ConnectableSubscriber.webpackJsonp.../../../../rxjs/_esm5/Subscriber.js.Subscriber._next (Subscriber.js:127)
at ConnectableSubscriber.webpackJsonp.../../../../rxjs/_esm5/Subscriber.js.Subscriber.next (Subscriber.js:91)
at ReplaySubject.webpackJsonp.../../../../rxjs/_esm5/Subject.js.Subject.next (Subject.js:56)
Read the Error Message - there is no Theme Named "dark"
maybe check scss files and theme module
on the last nb-register-theme is the name dark to register or not?
nb-register-theme?
I mean the "nb-enabled-themes" in the styles
Check these if there are set correctly
i follow this official guide, there only default and cosmic enabled...
https://akveo.github.io/nebular/#/docs/guides/enabling-theme-system
Edit:
// @nebular theming framework
@import '~@nebular/theme/styles/theming';
// @nebular out of the box themes
@import '~@nebular/theme/styles/themes';
// which themes you what to enable (empty to enable all)
$nb-enabled-themes: (default, cosmic, dark);
$nb-themes: nb-register-theme((
// app wise variables for each theme
sidebar-header-gap: 2rem,
sidebar-header-height: initial,
layout-content-width: 1400px,
font-main: Roboto,
font-secondary: Exo,
), default, default);
$nb-themes: nb-register-theme((
// app wise variables for each theme
sidebar-header-gap: 2rem,
sidebar-header-height: initial,
layout-content-width: 1400px,
font-main: Roboto,
font-secondary: Exo,
), cosmic, cosmic);
// dark theme
$nb-themes: nb-register-theme((
// app wise variables for each theme
sidebar-header-gap: 2rem,
sidebar-header-height: initial,
layout-content-width: 1400px,
font-main: Roboto,
font-secondary: Exo,
color-bg: black,
color-fg: gray,
), dark, cosmic);
Thanks, docu is wrong!
Edit2:
Error the same, but the first change works
ok found. under style was the them.dark.ts file missing and under module, i must load it. nothing in the documentation, sorry for this issues
Most helpful comment
ok found. under style was the them.dark.ts file missing and under module, i must load it. nothing in the documentation, sorry for this issues