All posts / JS / CSS / Design / Data / Motion

Responsive type scales with composable CSS utilities

Read more

With the help of calc(), clamp() and CSS vars, we can create composable, responsive, and fluid type scales that smoothly adapts to viewport and container widths.

Hiding empty elements with CSS :empty and :has()

Read more

You might be used to toggling classes on elements to handle state styles. What if we could just write CSS that reflected the state of the DOM?

Selecting previous siblings with CSS :has()

Read more

Selecting a previous sibling was for long impossible, but is now a breeze with the has() pseudo-class

Chaining styles with a JavaScript Proxy

Read more

If you miss method chaining from Ruby or jQuery when working with styles in JavaScript, you can recreate the pattern with a few lines of code

Smoother & sharper shadows with layered box-shadows

Read more
Default
Smooth

With a simple CSS trick, we can get fine-tuned control over how shadows are rendered, and create richer and more realistic 3D effects

Breaking to a new row with flexbox

Read more

You can break to a new flexbox row or column without setting the size of an item: add a collapsed flex item between two flex items

CSS masonry with flexbox, :nth-child(), and order

Read more

Creating a masonry (or mosaic) layout with flexbox produces a grid with a seemingly shuffled and obscure order, but we can achieve a natural ordering by using :nth-child() and the order property

Common CSS Flexbox Layout Patterns with Example Code

Read more

Quickly create grids, masonry, stacks and more layouts with these 10 CSS flexbox templates

Moving along a curved path in CSS with layered animation

Read more

We can apply one timing function per axis to produce curved paths, by using two or more objects to drive an animation.

How to animate box-shadow with silky smooth performance

Read more

Spoiler-alert: you don't. You use a pseudo-element.

Google Web Font Inspiration with TypeSource

Read more
TypeSource

I built a collection of compositions to make it easier to find and match Google Web Fonts.

Animating Link Underlines

Read more
Hover this text

A quick trick: add a pseudo-element and animate it with CSS transitions on hover.

Introducing SpinKit

Read more

A collection of loading spinners animated with CSS.

Say hi.

hello@
tobiasahlin.com

I love to design and make things. I used to make things at Spotify and Minecraft, and am currently a design engineer at GitHub. Say hi!

Tobias Ahlin Bjerrome
Stockholm, Sweden