Light Dark
1 min read
Description
Uses the light-dark() CSS function to automatically switch between light and dark color values based on the user's system preference or color scheme setting. This modern CSS feature eliminates the need for complex media queries when implementing dark mode support.
Syntax
/* Named color values */
color: light-dark(black, white);
/* RGB color values */
color: light-dark(rgb(0 0 0), rgb(255 255 255));
/* Custom properties */