0.1.2 • Published 2 months ago
@ngwam/ngx-generate-material-theme v0.1.2
Ngx Generate PWA Icons
This library was generated with Nx.
This Angular schematic generates an angular material theme from primary and accent hex color values, a dark mode is also generated.
Use it after adding @angular/material with schematics.
Usage
1. Install @angular/material
ng add @angular/material --project app-name --animations enabled --theme custom --typography
2. Run the schematic to generate a custom theme (replace color values with your own)
ng add @ngwam/ngx-generate-material-theme --projectName app-name --primaryColor '#702963' --accentColor '#FFC0CB'
N.B. Theme switcher
You will have to implement the theme switching service on your own.
// Here is an example snippet for changing the data-theme data attribute
const document = inject(Document);
document.body.setAttribute('data-theme-mode', 'dark');