Skip to content

Commit 795e873

Browse files
committed
fix(docs): 1. toggleDarkness() was added to the documentation
1. `toggleDarkness()` was added to the documentation 2. `setTheme()` was renamed to `setActiveTheme()` and Demo was updated
1 parent a7610b0 commit 795e873

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
Making able the app to switch between material themes at run-time
2727

28-
[![Video](https://raw.githubusercontent.com/mirismaili/AngularMaterialDynamicThemes/master/res/preview0.gif "Video")](https://github.com/mirismaili/AngularMaterialDynamicThemes)
28+
[![Video](https://raw.githubusercontent.com/mirismaili/AngularMaterialDynamicThemes/a979c0284577993c3f3b1c6acccbb7d6e6994003/res/preview0.gif "Video")](https://github.com/mirismaili/AngularMaterialDynamicThemes)
2929

3030
***
3131

@@ -104,10 +104,10 @@ export class AppComponent {
104104

105105
constructor(private overlayContainer: OverlayContainer) {
106106
// Set default theme here:
107-
this.setTheme('deeppurple-amber', /* darkness: */ false)
107+
this.setActiveTheme('deeppurple-amber', /* darkness: */ false)
108108
}
109109

110-
setTheme(theme: string, darkness: boolean = null) {
110+
setActiveTheme(theme: string, darkness: boolean = null) {
111111
if (darkness === null)
112112
darkness = this.isThemeDark
113113
else if (this.isThemeDark === darkness) {
@@ -127,10 +127,14 @@ export class AppComponent {
127127

128128
this.activeThemeCssClass = cssClass
129129
}
130+
131+
toggleDarkness() {
132+
this.setActiveTheme(this.activeTheme, !this.isThemeDark)
133+
}
130134
}
131135
```
132136

133-
And change the theme using `setTheme()` whenever you want. ✓
137+
And change the theme using `setActiveTheme()` (or `toggleDarkness()`) whenever you want. ✓
134138

135139
> **A more detailed instruction can be found here:**
136140
>

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-material-dynamic-themes",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Making able the app to switch between material themes at run-time",
55
"scripts": {
66
"README.md-TOC": "node markdown-toc.js -f README.md",

0 commit comments

Comments
 (0)