angular.json
file in assets
array:{
"glob": "**/css_variables.css",
"input": "./node_modules/@sap-theming/theming-base-content/content/Base/baseLib/",
"output": "./assets/theming-base/"
},
{
"glob": "**/*",
"input": "./node_modules/fundamental-styles/dist/theming/",
"output": "./assets/fundamental-styles-theming/"
}
<link rel="stylesheet" *ngIf="cssUrl" [href]="cssUrl"/>
<link rel="stylesheet" *ngIf="customCssUrl" [href]="customCssUrl"/>
...
import { SafeResourceUrl } from '@angular/platform-browser';
import { ThemesService } from '@fundamental-ngx/core';
...
export class AppComponent {
...
cssUrl: SafeResourceUrl | undefined;
cssCustomUrl: SafeResourceUrl | undefined;
constructor(private _themesService: ThemesService) {
_themesService.setThemeByRoute();
_themesService.onThemeQueryParamChange.pipe().subscribe(theme => {
this.cssCustomUrl = theme.customThemeUrl;
this.cssUrl = theme.themeUrl;
});
}
}
ng serve
and check out in a browser the app
http://localhost:4200/.
http://localhost:4200/?theme=sap_fiori_3_darkor to High Contrast Black
http://localhost:4200/?theme=sap_fiori_3_hcbYou must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
11 | |
11 | |
10 | |
9 | |
8 | |
8 | |
8 | |
7 | |
7 |