akveo / akveo/nebular

Changing theme does not update styles from nb-install-component

Open
#2,516 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.1k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

### Issue type

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

* [ x] bug report
* [ ] feature request

### Issue description

**Current behavior:**

Changing theme with a switch (using themeService.changeTheme('dark')) results in losing the classes defined in nb-install-component. While in the default theme those styles can use theme colors using nb-theme, after changing theme all styles defined in that block stop taking effect.
I have also observed problems themeService.currentTheme returning 'default' after changing to 'dark'. It can be a bug in my code, or caused by using Storybook, but I would like to request adding it to the documentation of themeService.
**Expected behavior:**

The colors described in scss should change to their maching versions from new theme, and all the other styles should still work.
**Steps to reproduce:**

1. Create angular library
2. Create component with the provided code
3. Add component to a Story
4. npm run storybook
Alternately you can just create an Angular project
**Related code:**

@include nb-install-component {
@include nb-theme-global();
.uploadfilecontainer {
background-repeat: no-repeat;
background-size: 10em;
background-position: center;
height: 20em;
width: 80%;
margin: 2em auto;
background-color: nb-theme(color-primary-300);
border: 0.2em dashed nb-theme(color-primary-500);
border-radius: 10em;
}

.uploadfilecontainer:hover {
cursor: pointer;
background-color: nb-theme(color-primary-400);
opacity: 0.5;
}
}

### Other information:

**npm, node, OS, Browser**

Node, npm:
node --version
v12.4.0
npm --version
6.12.0
OS: Windows 10
Browser: Opera

**Angular, Nebular**

"@angular/core": "~10.0.6",
"@nebular/auth": "^6.0.0",
"@nebular/eva-icons": "^6.0.0",
"@nebular/theme": "^6.0.1",

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.