You can follow the discussion on A custom --light-dark() function in CSS that works with any type of value (not just colors!) in just 3 LOC without having to leave a comment. Cool, huh? Just enter your email address in the form here below and you’re all set.