• 1 Post
  • 7.1K Comments
Joined 2 years ago
cake
Cake day: November 14th, 2023

help-circle










  • Check this simple example out:

    body {
      color-scheme: light dark;
    }
    
    p {
      color: light-dark(black, white);
      background-color: light-dark(white, black);
    }
    

    You don’t need any fancy selectors with this method. Will this not work in your browser due to the anti-fingerprinting feature?

    I will say, avoiding JavaScript completely will make the value reset after each reload, so might not be very useful perhaps, depending on your needs. You could store the value in localStorage, perhaps.