color-schemelight-dark()
(see .scheme-light, .scheme-dark or .scheme-light-dark CSS class to the <html> element or any HTML
element. This applies the selected theme to all child elements.PorscheDesignSystemModule.load() needs to be included in the bootstrapApplication config providers section using
// main.ts (standalone setup)
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent, {
providers: [importProvidersFrom(PorscheDesignSystemModule.load())],
}).catch((err) => console.error(err));
PorscheDesignSystemModule.load() function.CUSTOM_ELEMENTS_SCHEMA// app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { PorscheDesignSystemModule, WEB_COMPONENTS_PREFIX } from '@porsche-design-system/components-angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, PorscheDesignSystemModule.load({ prefix: 'sample-prefix' })],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
bootstrap: [AppComponent],
})
export class AppModule {}
// app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<div id="app">
<sample-prefix-p-heading p-heading size="xx-large">Heading</sample-prefix-p-heading>
</div>
`,
styles: [],
})
export class AppComponent {}
PorscheDesignSystemModule.load() multiple times or in your sub modules:// app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
PorscheDesignSystemModule.load({ prefix: 'sample-prefix' }),
PorscheDesignSystemModule.load({ prefix: 'another-prefix' }),
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
bootstrap: [AppComponent],
})
export class AppModule {}
