Color Schemes Boilerplate

A template for modern, fast and user-friendly website themes

Select a theme:

# Managing all the colors

Color Management is hard. You want your colors to look pretty. You also want them to be easy to read. You don't want to micro manage, because that's tedious work.
Here's a boilerplate CSS file that will help you generate light, dark and colorful themes from only a few variables.

--theme-hue: 210deg; 
--theme-sat: 20%; 
--theme-lit: 90%;

--theme-accent-hue: 200deg; 
--theme-accent-sat: 100%;
--theme-accent-lit: 25%;
(Custom properties are a must have, so this won't work on IE11. Go update your browser!)

Define a Hue, Saturation and Lightness and start out with a robust and accessible foundation for all colors and themes on your website.

I also included a little Javascript, that will help you switch themes as efficiently as it gets.
(This will require localStorage to work.)

# Input Elements

If your browser supports color-scheme, interactive elements will automatically adapt light or dark mode.

Cat




# Themed Browser UI

Look at me. Now look at the Browser Bar. Now look back at me. If your browser supports theme-color, this will paint your browser accordingly to the active theme.

A screenshot of this website. The Screenshot is split in three parts by slanted lines. Each part displays a 
					different theme: light, dark, cherry in this order.

window.themes includes a list of all themes with their according colors, so be sure to add your custom one here.

window.themes = {
	light: "#e0e6eb",
	dark: "#29333d",
	cherry: "#971127",
};

# Power to the people

Let your Users choose how to view your website. Give them manual control over the theme selection, in addition to a meaningful default.
Go on! Switch your device theme, activate the auto option and reload this page.

# How to use it

Make sure you can use Custom Properties and have access to localStorage. Then, copy the CSS and JavaScript files and add them to your project or clone the repo. As you add a theme by defining it with a new CSS class and add its background color to window.themes.
Build your own layout on top of this Boilerplate. Add more colors. Add more themes. Be creative!