3 ms·
I think `black` and `white` should be switched here: color: light-dark(black, white);
by davidkunz 3y ago
I think `black` and `white` should be switched here:
color: light-dark(black, white);
- 8n4vidtmkvmk 3y agoI don't think so. You want black text on a light theme/background.
- davidkunz 3y agoBut why is the order switched below? Functional notation: light-dark(light-color, dark-color)
- whiskers 3y agoIt's not.. `light-color` refers to the colour you want presented if the user's preference is for a "light" theme. It's not declaring the relative brightness of the two colours - I agree it could be documented a little less ambiguously with something like `light-theme-color`.
- davidkunz 3y agoI got confused because I thought it would set a background color. For text it's inverted and hence correct.
- erhaetherth 3y agoIt sets the foreground/text color because it's used with the `color` property (https://developer.mozilla.org/en-US/docs/Web/CSS/color https://developer.mozilla.org/en-US/docs/Web/CSS/color). You can use it to set the background color too in which case you'd do `background-color: light-dark(white, black);`
- davidkunz 3y agoSorry, I misread your answer. You're right. I automatically assumed setting some background color for which `color: light-dark(white, black);` would be right.