light-dark()
light-dark() is a CSS function in the Functions category. Returns computed values for use in CSS declarations. The syntax is light-dark(<color>, <color>). A typical example: color: light-dark(#333, #fff); It is commonly applied to markup such as <div class="demo">Sample</div> Browser support: Chrome 111+, Firefox 113+, Safari 16.2+, Edge 111+. A close relative is calc(), which performs mathematical calculations with mixed units. A close relative is min(), which selects the smallest value from a list. A close relative is max(), which selects the largest value from a list. More about this category: CSS functions — calc(), var(), clamp(), min(), max() and more. Related Functions entries: calc(), min(), max(), clamp(), var(), env(), url(), attr(). This page is part of the free CSS Reference documentation covering 841+ properties, selectors, functions, and at-rules, each with syntax, values, examples, and browser support. You can look up any other entry from the search page or return to the CSS Reference homepage.