Dark Mode

How do we detect and set the color scheme?

JavaScript detects the user’s preferred color scheme by checking the prefers-color-scheme media query (either light or dark). Once detected, we store the user’s preference in a cookie so the site can remember it across sessions.

At the CSS level, the script applies two key changes:

  1. It sets the color-scheme property on the :root element:

    :root {
      color-scheme: dark; /* or light, based on user preference */
    }

  2. It adds a corresponding class to the <body> element:

    <body class="theme-dark"> <!-- or "theme-light" -->

    This class allows for theme-specific styling through CSS. Wherever possible, we use the light-dark() function to define color values that adapt automatically based on the theme. For example:

    body {
      background-color: light-dark(#ffffff, #151515); /* white for light mode, dark gray for dark mode */
      color: light-dark(#000000, #f0f0f0); /* black for light mode, near-white for dark mode */
    }

CSS

Element Standard style Darkmode style
WolfPack red
#cc0000
#e74646
Secondary color (gray)
#666666
#777777
Success color (green)
#15770E
#10ae11
Body background color
#ffffff
#151515
Body font color (every element but h1 and a)
#333333
#dddddd
Anchor color
#cc0000
#f22222
Anchor color hover
#520000
#ab0000
Button color
#cc0000
#cc0000
Table striping (odd rows)
#eeeeee
#000000
Form input background color
#FFFFFF
#333333
Border color
#cccccc
#777777
Button disabled
#dddddd
#333333
Accordion color
#990000
#5e0000
Updated

Website feedback

What is the issue with this page?