-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2df71a4
commit b0e813c
Showing
8 changed files
with
74 additions
and
25 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
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,17 +1,40 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'; | ||
import { WINDOW } from '@ng-web-apis/common'; | ||
import { DestroyService, SchemeService } from '@services'; | ||
import { takeUntil } from 'rxjs'; | ||
import { Schemes } from '../interfaces/schemes.enum'; | ||
import { SchemeService } from '../services/scheme-service'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
providers: [DestroyService], | ||
}) | ||
export class AppComponent { | ||
protected Schemes = Schemes; | ||
private readonly bodyClassList!: DOMTokenList; | ||
|
||
constructor(protected readonly schemeService: SchemeService) {} | ||
constructor( | ||
@Inject(WINDOW) readonly window: Window, | ||
protected readonly schemeService: SchemeService, | ||
private destroy$: DestroyService | ||
) { | ||
this.bodyClassList = this.window.document.body.classList; | ||
} | ||
|
||
ngOnInit(): void {} | ||
ngOnInit(): void { | ||
this.listenForSchemeChange(); | ||
} | ||
|
||
private listenForSchemeChange() { | ||
this.schemeService.scheme$.pipe(takeUntil(this.destroy$)).subscribe(scheme => { | ||
this.toggleBodyClass(scheme as Schemes); | ||
}); | ||
} | ||
|
||
private toggleBodyClass(scheme: Schemes) { | ||
this.bodyClassList.remove(scheme === Schemes.Dark ? Schemes.Light : Schemes.Dark); | ||
this.bodyClassList.add(scheme); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
projects/ngx-tippy-demo/src/components/t-demo-content/t-demo-content.component.html
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 @@ | ||
<!-- <p>t-demo-content works!</p> --> | ||
<p>t-demo-content works!</p> |
2 changes: 1 addition & 1 deletion
2
projects/ngx-tippy-demo/src/components/t-demo-footer/t-demo-footer.component.html
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 @@ | ||
<!-- <p>© 2023 — MIT License</p> --> | ||
<p>© 2023 — MIT License</p> |
4 changes: 3 additions & 1 deletion
4
projects/ngx-tippy-demo/src/components/t-demo-nav/t-demo-nav.component.html
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,3 @@ | ||
<!-- <p>t-demo-nav works!</p> --> | ||
<ul> | ||
<li><a href="#">Getting started</a></li> | ||
</ul> |
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,3 +1,23 @@ | ||
$header-height: 84px; | ||
$main-bg-color: #f9f8f5; | ||
$main-font-size: 18px; | ||
|
||
$sol-base0: #839496; | ||
|
||
$sol-dark-base00: #657b83; | ||
$sol-dark-base01: #586e75; | ||
$sol-dark-base02: #073642; | ||
$sol-dark-base03: #002b36; | ||
|
||
$sol-light-base1: #93a1a1; | ||
$sol-light-base2: #eee8d5; | ||
$sol-light-base3: #fdf6e3; | ||
|
||
$sol-yellow: #b58900; | ||
$sol-orange: #cb4b16; | ||
$sol-red: #dc322f; | ||
$sol-magenta: #d33682; | ||
$sol-violet: #6c71c4; | ||
$sol-blue: #268bd2; | ||
$sol-cyan: #2aa198; | ||
$sol-green: #859900; |