Open daveboulden opened 5 years ago
Hi @daveboulden. Theme variables were heavily updated during migration to the Eva Design system in Nebular 4, so header-fg
became header-text-color
and header-bg
became header-background-color
. (full list of header variables)
Changing variable names to new ones should do the trick.
In case you have other Nebular components in the header, you also need to include dark theme into themes setup and add nb-theme-dark
css class to the ngx-header
element. This will change the theme for the header components.
To enable dark theme add $nb-enabled-themes: (corporate, dark);
to the themes.scss
file. Theme names order is important here, please, don't change it.
Many thanks for that explanation. I now have the colouring I require and understand better how the theming is wired up. I now have this theme entry:
$nb-themes: nb-register-theme((
header-text-color: #ddd,
header-background-color: #111,
user-picture-box-background-color: #ddd,
user-picture-box-border-color: #ccc,
user-initials-text-color: #1a2138,
user-name-text-color: #ddd,
user-title-text-color: #ccc,
actions-icon-color: #ddd,
actions-divider-color: #666,
card-header-info-background-color: #888,
), mytheme, corporate);
I am changing the background colour of the "info" status card header. Is there a formalised way to create custom statuses so that I don't have to hijack the "-info" status to recolour the card headers within just one part of my app?
e.g:
<nb-card status="mycustomstatus"> <-------------------------------------
<nb-card-header [innerHTML]='EditorTitle'></nb-card-header>
<nb-card-body>
.... some content ...
</nb-card-body>
</nb-card>
@daveboulden There is no config for statuses. My suggestion is to extend NbCardComponent
and add host binding for the custom status:
export class MyCustomCard extends NbCardComponent {
@HostBinding('class.status-custom')
get customStatus() {
return this.status === 'custom';
}
}
Then you can add stylesheet for this component and add styles you need for the custom status.
@yggg Thank you Sergey!
@yggg mr. do you know by chance if there's any hack to use linear-gradient function on header-background-color? On previous variable (header-bg) I was able to use gradient without problem. I tried header-background-color:linear-gradient(270deg, #a2c3f3 0%, #3d5c96 100%), and header-bg: linear-gradient(to right, #a2c3f3, #3d5c96), without any luck. Hope you can help me with this issue.
I have registered an extra theme for my app. I want to recreate the "white text, black background" navigation header style from the previous version of the Corporate theme.
I have registered my new theme (based on Corporate) in
/src/app/@theme/styles/themes.scss
:Which style overrides do I need to add to change the header colouring as required?
I tried some examples form the Nebular documentation (
header-fg
andheader-bg
), but it made no difference.