Roma Komarov on Nostr: My new post: “Querying the Color Scheme”. Media queries are nice, but for many ...
My new post: “Querying the Color Scheme”.
https://blog.kizu.dev/querying-the-color-scheme/Media queries are nice, but for many things, we don’t even need them: there is this great #CSS property `color-scheme`, which allows us to make various things adapt to the current color scheme. We can even set it on a per-element basis. This post describes how we can use registered custom properties and style queries to read the current value of a `light-dark()` color for styling any non-color properties as well.
Published at
2024-08-29 13:21:16Event JSON
{
"id": "9e940f034d3afa7a3ac56c6a353fc33bafa578edc2fd69c85daaa598ea6c9992",
"pubkey": "1ea5c2d0e935fb9fa76516688fbe2515d64704ee93ac3abf4198b15a125376e6",
"created_at": 1724937676,
"kind": 1,
"tags": [
[
"t",
"css"
],
[
"proxy",
"https://front-end.social/users/kizu/statuses/113045515536244044",
"activitypub"
]
],
"content": "My new post: “Querying the Color Scheme”.\n\nhttps://blog.kizu.dev/querying-the-color-scheme/\n\nMedia queries are nice, but for many things, we don’t even need them: there is this great #CSS property `color-scheme`, which allows us to make various things adapt to the current color scheme. We can even set it on a per-element basis. This post describes how we can use registered custom properties and style queries to read the current value of a `light-dark()` color for styling any non-color properties as well.",
"sig": "bbc7a974e4a2fc30cffeaaeca1daf531b55492894b5c80fa3c0d9dd0d54833d13363513c240cfb655af8a30ab612f517fd62153d93168c49bbfb6391635fe894"
}