---
title: "Comment by Godstime Onyibe on \"Dark Theme in your website with one line of Js Code\" | Hashnode"
description: "Please could not add it in my web page. Am using it directly in the browser. Please some some one should help out."
url: "https://hashnode.com/posts/dark-theme-in-your-website-with-one-line-of-js-code/5f30c91c3348367b2fc3f98a/comment/5f3f0239dfbb4247f7c14bc8"
---

[Discussion](https://hashnode.com/posts/dark-theme-in-your-website-with-one-line-of-js-code/5f30c91c3348367b2fc3f98a)

Comment [Dark Theme in your website with one line of Js Code](https://hashnode.com/posts/dark-theme-in-your-website-with-one-line-of-js-code/5f30c91c3348367b2fc3f98a)

[Godstime Onyibe](https://hashnode.com/@Godstime)

[Aug 20, 2020](https://hashnode.com/posts/dark-theme-in-your-website-with-one-line-of-js-code/5f30c91c3348367b2fc3f98a/comment/5f3f0239dfbb4247f7c14bc8)

Please could not add it in my web page. Am using it directly in the browser. Please some some one should help out.

[Anjal Binayak Adhikari](https://hashnode.com/@anjalbinayakadhikari)

[Aug 21, 2020](https://hashnode.com/posts/dark-theme-in-your-website-with-one-line-of-js-code/5f30c91c3348367b2fc3f98a/comment/5f3f0239dfbb4247f7c14bc8#reply-5f3f2bbbdfbb4247f7c14c99)

Please read the documentation in [here](https://github.com/anjalbinayak/dark-theme-switcher) or contact [Luiz Filipe da Silva](https://hashnode.com/@luizfilipezs)

[Luiz Filipe da Silva](https://hashnode.com/@luizfilipezs)

[Aug 21, 2020](https://hashnode.com/posts/dark-theme-in-your-website-with-one-line-of-js-code/5f30c91c3348367b2fc3f98a/comment/5f3f0239dfbb4247f7c14bc8#reply-5f3f2f555b3ac8481821c49e)

Hey, [Godstime Onyibe](https://hashnode.com/@Godstime)! Currently, the code is stable and works fine.

Add the script before the closing tag `body`, as it follows:

```
  ...
  <script src="cdn.jsdelivr.net/gh/luizfilipezs/dark-theme-switc…"></script>
  <script type="text/javascript">
    new ThemeSwitcherGenerator().init();
    // or
    new ThemeSwitcher(someElement).init();
  </script>
</body>
```

> Remember that what the package does is inverting the colors. So, to change the background of your body tag, as an example, you must give it a background color.

[Godstime Onyibe](https://hashnode.com/@Godstime)

[Sep 3, 2020](https://hashnode.com/posts/dark-theme-in-your-website-with-one-line-of-js-code/5f30c91c3348367b2fc3f98a/comment/5f3f0239dfbb4247f7c14bc8#reply-5f5161fe81d8ab6c5765ebfb)

[Luiz Filipe da Silva](https://hashnode.com/@luizfilipezs) Thanks i have applied it and is working great 😍💕

[Luiz Filipe da Silva](https://hashnode.com/@luizfilipezs)

[Sep 3, 2020](https://hashnode.com/posts/dark-theme-in-your-website-with-one-line-of-js-code/5f30c91c3348367b2fc3f98a/comment/5f3f0239dfbb4247f7c14bc8#reply-5f5172d081d8ab6c5765ec64)

🥳🥳 [Godstime Onyibe](https://hashnode.com/@Godstime)
