Why Nostr? What is Njump?
2024-08-22 08:21:15

rixx on Nostr: TIL: relative colours in #CSS. You define an origin colour, and then modify (with the ...

TIL: relative colours in #CSS. You define an origin colour, and then modify (with the magic r/g/b/alpha variables for rgb) or override the values. Supported in all major browsers now (except Firefox for Android): https://caniuse.com/css-relative-colors

Example: Use the primary colour, but make it transparent and reduce how green it is:

rgb(from var(--primary-colour) r calc(g/2) b / calc(alpha * 0.5))
Author Public Key
npub1puxwtxsgje7exqm63ngglj9xnp3m7a26jt9cgfr60ag580p8l0as69xw53