Dark mode for any HTML site

On a site you build yourself, the line goes into the head of every page, next to your other scripts and styles.

Add DarkYes to your HTML pages

  1. Create a free DarkYes account and add your site's address. In your dashboard, press Get the code next to the site, then Copy code.

    Your line looks like this, with your own key in place of YOUR-KEY:

    <script src="https://darkyes.com/d.js" data-key="YOUR-KEY" async></script>
  2. Open the HTML of each page, or the template or layout file that holds your <head>.

  3. Paste your line inside <head>, for example just before </head>.

  4. Upload or deploy the changed files.

Your key also works on localhost, so you can try it before you deploy.

Check that it works

  1. Open your site in a private window.

  2. Look for the switch in the bottom-right corner, and press it.

  3. In your dashboard, the site changes from “Waiting for the first visit” to “Active”.

Remove it

Delete the line and deploy again.

Your site then looks exactly as it did before.

Try it on your own site.

Create a free account, add your site and paste one line. When your first site goes live, you get 14 days of Pro for free.

Start freeNo card needed.