The first property "object-view-box" allows us to apply an SVG like viewBox to an element such as an <img>. In this demo, I map the different "viewBox" to the different "Zoom" spots.
Next up, how do we change the zoom by hitting the radio buttons without JavaScript?
Well, let's introduce :has() (The parent selector) ๐
If we detect a certain radio button is :checked under :root, we can update the custom properties in :root ๐ฅ
Last but not least, Houdini's "@ property" or the Properties and Values API ๐
This allows us to animate and transition custom properties by providing context to the browser via types ๐ค When the browser knows a type, it can transition things, like our inset values! ๐ซ
Thanks for reading my spontaneous and random collection of tweets for a demo I spontaneously threw together quick in a moment of inspiration โจ
Stay awesome y'all!
โจ
ส โขแดฅโขส๏ผ
p.s In my excitement, I completely forgot to mention...
"Chrome Canary with Experimental Web Platform Features flag on" โณ๏ธ๐ฆ
It's late. I'm hungry. But, I'm also very excited about what amazing CSS things we're going to be cooking up! ๐
p.p.s Get ready for "โก๏ธ Speedy CSS Tips! โก๏ธ" style content on this coming soon! ๐
โข โข โข
Missing some Tweet in this thread? You can try to
force a refresh