nightlife
nightlife detects users location and calculates sunrise and sunset time at their location, to apply a different style at night time.
If user location can not be retrieved, it is assumed that the night goes from 6pm to 6am, local time.
Install
<!-- inside your <head> -->
Night mode CSS
If you want a default basic night theme, you can use this one: it inverts the lightness of all colors except for images and videos.
If you want your own styles at night time, use this media query:
{ /* these styles will apply at night time */ /* or if user explicitely asks for a dark color scheme */}
This media query is currently not supported on most browsers, so you will also have to use this : css-prefers-color-scheme
API
nightlife nightlifenightlife nightlife // manually toggle on and off night modenightlife // force on night modenightlife // force off night mode nightlife