Skip to content
This repository was archived by the owner on Feb 3, 2024. It is now read-only.

Commit 740bfd5

Browse files
committed
finish rename, fix types
1 parent 26958aa commit 740bfd5

12 files changed

Lines changed: 22 additions & 18 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ In the rest of your app use `--color` and `--background` as needed.
6060
- The first call of your listener is synchronous so you can get the value before rendering.
6161

6262
```js
63-
const { mode } = window.__perfect_color_mode__
63+
const { mode } = window.__perfect_dark_mode__
6464
const unsubscribe = mode.subscribe((v) => console.log(v))
6565
```
6666

@@ -70,7 +70,7 @@ const unsubscribe = mode.subscribe((v) => console.log(v))
7070
- You can `update` the mode based on the current mode.
7171

7272
```js
73-
const { mode } = window.__perfect_color_mode__
73+
const { mode } = window.__perfect_dark_mode__
7474
mode.set('light')
7575
mode.update((mode) => (mode === 'light' ? 'dark' : 'light'))
7676
```

β€Ždist/index.d.tsβ€Ž

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ export interface Writable<T> extends Readable<T> {
2828
}
2929
declare type ColorMode = string;
3030
export interface PerfectColorMode {
31-
mode: Writable<ColorMode> & {
32-
get: () => ColorMode;
33-
};
31+
mode: Writable<ColorMode | undefined>;
3432
colorModes: ColorMode[];
3533
}
3634
declare global {
3735
interface Window {
38-
__perfect_color_mode__: PerfectColorMode;
36+
__perfect_dark_mode__: PerfectColorMode;
3937
}
4038
}
4139
export {};

β€Ždist/index.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Ždist/index.js.mapβ€Ž

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

β€Žexamples/vanilla/index.htmlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h2>Vanilla Example</h2>
6464
</label>
6565
<p>You can reset the color mode and fallback to system color mode.</p>
6666
<button id="button">Reset</button>
67-
<script>const { mode } = window.__perfect_color_mode__
67+
<script>const { mode } = window.__perfect_dark_mode__
6868

6969
const label = document.getElementById('label')
7070
const checkbox = document.getElementById('checkbox')

β€Žexamples/vanilla/index.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { mode } = window.__perfect_color_mode__
1+
const { mode } = window.__perfect_dark_mode__
22

33
const label = document.getElementById('label')
44
const checkbox = document.getElementById('checkbox')

β€Žexamples/vanilla/perfect-dark-mode/index.d.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface PerfectColorMode {
3535
}
3636
declare global {
3737
interface Window {
38-
__perfect_color_mode__: PerfectColorMode;
38+
__perfect_dark_mode__: PerfectColorMode;
3939
}
4040
}
4141
export {};

β€Žexamples/vanilla/perfect-dark-mode/index.jsβ€Ž

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
Β (0)