akveo / akveo/nebular

Theme is not a map.

未关闭
#3,235 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
8.1k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

描述

### Issue type

**I'm submitting a ...** (check one with "x")

* [x] bug report
* [ ] feature request

### Issue description

**Current behavior:**
After trying to register a custom theme with I get the following error when running `ng serve`

```
✘ [ERROR] $map: nb-register-theme ((color-primary-300: #56D1A4), default, default) is not a map.

41 │ $theme: map.get(theming-variables.$nb-themes, $name);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

node_modules/@nebular/theme/styles/core/theming/_register.scss 41:11 nb-get-registered-theme()
node_modules/@nebular/theme/styles/core/theming/_install.scss 126:55 nb-install-global-with-css-props()
node_modules/@nebular/theme/styles/core/theming/_install.scss 145:5 nb-install()
src/app/@theme/styles/styles.scss 29:1 root stylesheet [plugin angular-sass]
```

**Expected behavior:**

Variables, defined in nb-register-theme should be applied to the parent theme. `ng serve` should run without errors.

**Steps to reproduce:**

Imported nebular theme into my `themes.scss` and registered a theme, followed by the Docs.

**Related code:**

themes.scss
```
@import '@nebular/theme/styles/theming';
@import '@nebular/theme/styles/themes';

$nb-themes: nb-register-theme ( (
color-primary-300: $brand-color-primary
) , default, default);
```

styles.scss
```
@use 'themes' as *;

@use '@nebular/theme/styles/globals' as *;
@import '@nebular/theme/styles/core/mixins';
@import '@nebular/auth/styles/globals';
@import 'bootstrap/scss/bootstrap';
@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/mixins';
@import 'bootstrap/scss/grid';
@import './pace.theme';

@include nb-install() {

// framework global styles
@include nb-theme-global();
@include nb-auth-global();

// loading progress bar
@include ngx-pace-theme();
}
```

### Other information:

**npm, node, OS, Browser**
```
yarn version: 1.22.19
node Version: v18.17.1
macOS Sonoma (14.1)
```

**Angular, Nebular**
```
@angular/cdk@16.2.12
@angular/cli@16.2.11
@angular/animations@16.2.12
@angular/common@16.2.12
@angular/core@16.2.12
@angular/compiler-cli@16.2.12
@angular/compiler@16.2.12
@angular/forms@16.2.12
@angular/language-service@16.2.12
@angular/localize@16.2.12
@angular/platform-browser@16.2.12
@angular/platform-browser-dynamic@16.2.12
@angular/router@16.2.12
nebular-icons@1.1.0
@nebular/theme@12.0.0
@nebular/auth@12.0.0
@nebular/eva-icons@12.0.0
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。