Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Nov 17, 2020
1 parent dd5c399 commit eef9e83
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Set theme in `document.body` or `document.documentElement` by default

## [0.2.0](https://github.com/metonym/svelte-dark-mode/releases/tag/v0.2.0) - 2020-11-17

- add TypeScript definitions

## [0.1.1](https://github.com/metonym/svelte-dark-mode/releases/tag/v0.1.1) - 2020-09-17

**Fixes**
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The preferred theme is persisted locally using [window.localStorage](https://dev

## Install

```bash
```sh
yarn add -D svelte-dark-mode
# OR
npm i -D svelte-dark-mode
Expand All @@ -21,7 +21,7 @@ npm i -D svelte-dark-mode

The initial `theme` is set to either `"dark"` or `"light"` based on the user’s system preference.

```html
```svelte
<script>
import DarkMode from "svelte-dark-mode";
Expand All @@ -44,7 +44,7 @@ The initial `theme` is set to either `"dark"` or `"light"` based on the user’s

If your app uses server-side rendering (SSR), you may need to employ the `afterUpdate` lifecycle hook because `document` is a browser API.

```html
```svelte
<script>
import DarkMode from "svelte-dark-mode";
import { afterUpdate } from "svelte";
Expand All @@ -65,7 +65,7 @@ If the user changes their color scheme preference at the system level, the theme

By default, this component uses `"theme"` as the key to persist the theme. Supply your own value through the `"key"` prop.

```html
```svelte
<DarkMode key="custom-theme-key" />
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-dark-mode",
"version": "0.1.1",
"version": "0.2.0",
"license": "MIT",
"description": "Support dark mode in your Svelte apps",
"author": "Eric Liu (https://github.com/metonym)",
Expand Down

0 comments on commit eef9e83

Please sign in to comment.