Mocking Individual CSS Transform Functions using CSS Variables

In CSS we use the transform property to manage an element’s translation, rotation, and scale. As it’s one single combined property for all three possible transformations, setting transform: rotation(90deg); on an element will (re)set the values for translation and scale by falling back to their default values. This will change when the “CSS Transform Module …

Deep dive CSS: font metrics, line-height and vertical-align

Line-height and vertical-align are simple CSS properties. So simple that most of us are convinced to fully understand how they work and how to use them. But it’s not. They really are complex, maybe the hardest ones, as they have a major role in the creation of one of the less-known feature of CSS: inline …

Reactive Animations with CSS Variables

Despite its name, reactive animations have nothing to do with React, the framework/library/whatever it is. Rather, reactive animations can be described in terms of discrete changes caused by any number of events. The overall idea is that JS captures multiple streams of events into a single stream, and emits those values over to CSS, where …

Style Scoping with Element Queries using EQCSS

Update 2020-11-05: CSS Container Queries are coming! Tommy Hodgins on Style Scoping: Style scoping is the idea that you can select an element anywhere in your document to serve as a point of reference as you write styles. To achieve this he uses EQCSS, a JavaScript plugin to writing CSS Element Queries (which essentially are …

Stripe.com Alike Morphing Navigation Dropdown

Analysis and reproduction – using jQuery – of the morphing navigation dropdown as seen on stripe.com: Instead of hiding and showing a new dropdown “container” when the user switches from one navigation item to the other, they animate the dropdown background to make space for different content sizes. The trick is that the dropdown items …