1.0.0-beta.3 • Published 6 years ago

pip-webui2-themes-temp v1.0.0-beta.3

Weekly downloads
22
License
-
Repository
github
Last release
6 years ago

Color Themes

npm.io

Pip.WebUI 2 Themes module contains a mechanism to define and dynamically switch color themes for both Angular Material and custom controls.

Using

Add module to imports:

import { PipThemesModule } from 'pip-webui2-themes';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    ...
    PipThemesModule,
    ...
  ],
  providers: [],

  bootstrap: [AppComponent]
})
export class AppModule { }

Use service to change theme, get theme list and name of current theme.

import { PipThemesService, Theme } from 'pip-webui2-themes';

export class AppComponent {
    public themes: Theme[];
    public theme: Theme;

    constructor(
        private service: PipThemesService
    ) {
        this.themes = this.service.themes;
        this.theme = this.service.selectedTheme;
    }

    changeTheme() {
        this.service.selectedTheme = this.theme;
  }
}

Theme model:

class Theme {
    name: string;
    palette: string = 'light';
}

Installation

To install this module using npm:

npm install pip-webui2-themes --save

License

This module is released under MIT license and totally free for commercial and non-commercial use.

1.0.0-beta.3

6 years ago

1.0.0-beta.2

6 years ago

1.0.0-beta.1

6 years ago

0.0.2

6 years ago