Loading tutorials
prefers-color-scheme media query in the previous chapter. Here you move the color values out of your rules and into named variables, so a dark theme only h3 min readprefers-color-scheme media query, and the cascade. Here you will organize your colors so that adding a dark theme means changing a small set of values and leaving your component rules alone.2 min readprefers-color-scheme media query, and the idea of semantic color tokens from earlier chapters. You should also be comfortable reading basic HTML.3 min readprefers-color-scheme and CSS custom properties work from the earlier chapters. You will learn how light-dark() lets you put both theme colors in a single declaration, and where it 3 min readprefers-color-scheme media query, and that you can set DOM attributes from JavaScript. You should also know the color-scheme property from the previous chapters.3 min readdata-theme attribute and CSS custom properties from the previous chapters. It also assumes you can read and write DOM attributes with JavaScript. Here you will store the visitor's choice and apply it before the page first paints.3 min readprefers-color-scheme media query, and have already defined semantic color tokens such as --bg and --text. Here you decide which values those tokens should hold in dark mode.3 min readprefers-color-scheme media query, and have a light and dark set of color tokens like the ones built earlier in this tutorial. Here you will check that both themes stay readable for people with low vision, and you will respect other3 min readprefers-color-scheme query and the data-theme toggle pattern.2 min readprefers-color-scheme media query, and a data-theme toggle saved in localStorage. You should also know how to open your browser's developer tools. Here you will check that each theme works w3 min readprefers-color-scheme, custom properties, the color-scheme property, and a data-theme toggle. You should also be able to read and set DOM attributes with JavaScript.3 min read