From d2b0adab189cf7995c03cab164a4d153e8f84258 Mon Sep 17 00:00:00 2001 From: Thomas Steiner Date: Wed, 4 Sep 2019 16:57:10 +0200 Subject: [PATCH] Remove superfluous step in demo --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 57e5ac1..1e2fb96 100644 --- a/README.md +++ b/README.md @@ -117,8 +117,6 @@ import * as DarkModeToggle from 'https://cdn.pika.dev/dark-mode-toggle'; const toggle = document.querySelector('dark-mode-toggle'); const body = document.body; -// Initialize the toggle based on `prefers-color-scheme`, defaulting to 'light'. -toggle.mode = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; // Set or remove the `dark` class the first time. toggle.mode === 'dark' ? body.classList.add('dark') : body.classList.remove('dark');