A pure html and css library for dark mode in your website.

Overview

Dark Mode

A pure html and css library for dark mode in your website.


Features

It has a smooth setting and also it changes via system settings aswell. Small, but useful.


Usage

To use this library follow the steps below:

First, import the css with the following:

<link rel="stylesheet" href="https://kk-designs.github.io/dark-mode/dark-mode.css">

Then you need the javascript with can be done similar to the css:

<script src="https://kk-designs.github.io/dark-mode/dark-mode.js"></script>

Once your done with the imports your code looks something like this:

<!DOCTYPE html>
<html>
   <head>
      <link rel="stylesheet" href="https://kk-designs.github.io/dark-mode/dark-mode.css">
      <script src="https://kk-designs.github.io/dark-mode/dark-mode.js"></script>
   </head>
   <body>
      <!-- Body content yet to be added -->
   </body>
</html>

Now its time to add the last element; The button. Add it in the body as the following:

<button onclick='changeToDarkMode();'>Toggle dark mode</button>

And boom your done! See options and more below.


Settings

Want to customize it? We'll we have some options for you. More options coming in the feature.

The only option we have right now is smooth change. It makes a trasistion so it doesn't look so abrupt. See the code below have to to get this:

<button onclick='changeToDarkMode({ "smooth_transition": true });'>Toggle dark mode</button>

Demo

Use this demo to see how it works.

DEMO


Thanks for using this library!


You might also like...

Reseter.css - A Futuristic CSS Reset / CSS Normalizer

Reseter.css - A Futuristic CSS Reset / CSS Normalizer

Reseter.css A CSS Reset/Normalizer Reseter.css is an awesome CSS reset for a website. It is a great tool for any web designer. Reseter.css resets all

Jan 2, 2023

RxHtmlButtonLibrary - Html Button Styling Library by roxunlimited.com using CSS and jQuery.

RxHtmlButtonLibrary - Html Button Styling Library by roxunlimited.com using CSS and jQuery.

rxHTMLButton Library v0.3 rxHTMLButton Library will work on almost every HTML tag. It will smoothly work on 'a href link', 'button type button', 'inpu

Sep 16, 2022

Simple CSS library for semantic HTML markup

Simple CSS library for semantic HTML markup

awsm.css awsm.css is a simple CSS library for semantic HTML, which doesn't require classes, ids, attributes, etc. Just start to create page with HTML5

Dec 30, 2022

micro-library for CSS Flexbox and CSS Grid

SpeedGrid micro-library for CSS Flexbox and CSS Grid Overview SpeedGrid dynamically generates inline CSS by specifying the class name. Easy maintenanc

Mar 26, 2022

Low-level CSS Toolkit – the original Functional/Utility/Atomic CSS library

Basscss Low-level CSS toolkit – the original Functional CSS library https://basscss.com Lightning-Fast Modular CSS with No Side Effects Basscss is a l

Dec 31, 2022

🖼 A pure client-side landing page template that you can fork, customize and host freely. Relies on Mailchimp and Google Analytics.

landing-page-boilerplate A pure client-side landing page template that you can freely fork, customize, host and link to your own domain name (e.g. usi

Dec 24, 2022

A simple, one page, Bootstrap HTML website template created by Start Bootstrap

A simple, one page, Bootstrap HTML website template created by Start Bootstrap

Start Bootstrap - One Page Wonder One Page Wonder is a basic one page template for Bootstrap created by Start Bootstrap. Preview View Live Preview Sta

Dec 18, 2022

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Bootstrap Sleek, intuitive, and powerful front-end framework for faster and easier web development. Explore Bootstrap docs » Report bug · Request feat

Jan 1, 2023

The fastest way to build beautiful Electron apps using simple HTML and CSS

Photon UI toolkit for building desktop apps with Electron. Getting started Clone the repo with git clone https://github.com/connors/photon.git Read th

Dec 29, 2022
Releases(v1.0.0)
Owner
👨‍💻 JS | TS | HTML Developer 🤖 Invite my bot: https://tinyurl.com/coolboibot -----
null
Light-switch-bootstrap - Dark mode toggle for Bootstrap 5

?? Light Switch for Bootstrap 5 Basic Bootstrap 5 custom checkbox to use night mode in your web site. Under the hood Switching to dark mode is done by

Han 35 Jan 2, 2023
Giggy is a collection of a few fun jokes related to Coding & Dark Humor - Created using HTML, JavaScript, CSS & Webpack.

Giggy A Collection of some of the best jokes. This is a Web Application with some jokes related to coding & Dark Humor. Created with data from the Jok

Awais Amjed 7 Jul 28, 2022
Cooltipz.css - A highly customisable, minimal, pure CSS tooltip library

Cooltipz.css - Cool tooltips Cool customisable tooltips made from pure CSS Lightweight • Accessible • Customisable • Simple Cooltipz.css is a pure CSS

Jack Domleo 110 Dec 24, 2022
Tiny CSS framework with almost no classes and some pure CSS effects

no.css INTERACTIVE DEMO I am tired of adding classes to style my HTML. I just want to include a .css file and I expect it to style the HTML for me. no

null 96 Dec 10, 2022
Data-tip.css - Wow, such tooltip, with pure css!

Notice: hint.css has been much better since I complained about it months ago, so try out its new features instead of this one! data-tip.css Wow, such

EGOIST 117 May 26, 2021
Install the latest artifacts automatically and launch your server in a production ready mode with accessible convars.

Setup Edit the first three lines of the index.ts file to set your custom folder layout, follow the folder structure below for a example. const server_

null 2 Feb 4, 2022
This stylesheet customizes Jupyter Notebooks to a dark-theme with vibrant pink, blue, and lime accents.

jupyter-dragonfruit-theme This stylesheet customizes Jupyter Notebooks to a dark-theme with vibrant pink, blue, and lime accents. Author Website Conta

Allen Chang 1 Jan 29, 2022
700+ Pure CSS, SVG & Figma UI Icons Available in SVG Sprite, styled-components, NPM & API

700+ Pure CSS, SVG & Figma UI Icons Available in SVG Sprite, styled-components, NPM & API

Astrit Malsija 8.9k Jan 2, 2023
Delightful, performance-focused pure css loading animations.

Loaders.css Delightful and performance-focused pure css loading animations. What is this? See the demo A collection of loading animations written enti

Connor Atherton 10.2k Jan 4, 2023
Pure CSS gauge component

Pure CSS gauge v0.2 Basic gauge component made with only CSS style rules. No SVG or canvas used in this component. This component can be easily themed

Otto Salminen 4 Oct 7, 2021