-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: peer deps updated to angular v18
- Loading branch information
1 parent
cbaf667
commit 5c0dce3
Showing
27 changed files
with
516 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { DOCUMENT } from '@angular/common'; | ||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; | ||
import { NgDocThemeService, NgDocTheme, NG_DOC_NIGHT_THEME } from '@ng-doc/app'; | ||
|
||
@Component({ | ||
selector: 'docs-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class AppComponent {} | ||
export class AppComponent { | ||
private themeService = inject(NgDocThemeService); | ||
private document = inject(DOCUMENT); | ||
|
||
constructor() { | ||
this.handleTheme(this.themeService.currentTheme); | ||
this.themeService.themeChanges().subscribe(theme=>{ | ||
this.handleTheme(theme); | ||
}) | ||
} | ||
|
||
private handleTheme(theme: NgDocTheme | undefined) { | ||
if (theme?.id === NG_DOC_NIGHT_THEME.id) { | ||
this.document.documentElement.classList.add("dark-theme"); | ||
} else { | ||
this.document.documentElement.classList.remove("dark-theme"); | ||
} | ||
} | ||
|
||
toggleMaterialDesign() { | ||
this.document.documentElement.classList.toggle("m2"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@use '@angular/material' as mat; | ||
@use 'projects/mat-timepicker' as mat-timepicker; | ||
|
||
@mixin theme($theme) { | ||
@include mat.core-theme($theme); | ||
@include mat.toolbar-theme($theme); | ||
@include mat.form-field-theme($theme); | ||
@include mat.input-theme($theme); | ||
@include mat.button-theme($theme); | ||
@include mat.fab-theme($theme); | ||
@include mat.icon-button-theme($theme); | ||
@include mat.divider-theme($theme); | ||
@include mat.card-theme($theme); | ||
@include mat-timepicker.timepicker-theme($theme); | ||
} | ||
|
||
@mixin color($theme) { | ||
@include mat.core-color($theme); | ||
@include mat.toolbar-color($theme); | ||
@include mat.form-field-color($theme); | ||
@include mat.input-color($theme); | ||
@include mat.button-color($theme); | ||
@include mat.fab-color($theme); | ||
@include mat.icon-button-color($theme); | ||
@include mat.divider-color($theme); | ||
@include mat.card-color($theme); | ||
@include mat-timepicker.timepicker-color($theme); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@forward "./timepicker-theme" as timepicker-* show timepicker-theme; | ||
@forward "./timepicker-theme" as timepicker-* show timepicker-theme, timepicker-color; |
Oops, something went wrong.