Search
Solving Background Overflow With Inherited Border Radii
17.10.2024
One of the interesting (but annoying) things about CSS is the background of children’s elements can bleed out of the border radius of the parent element. Here’s an example of a card with an inner element. If the inner element …
Solving Background Overflow With Inherited Border Radii...
How to Create Wavy Shapes & Patterns in CSS
26.9.2022
The wave is probably one of the most difficult shapes to make in CSS. We always try to approximate it with properties like border-radius and lots of magic numbers until we get something that feels kinda close. And that’s before …
How to Create Wavy Shapes & Patterns in CSS originally...
Other Looks at the Conditional Border Radius Trick
13.11.2021
Remember when Ahmad Shadeed wrote about that border-radius “toggle” he found in Facebook’s CSS? It was interesting! I covered it. A few weeks after that surge of linkage, a couple of articles came out digging into it a little deeper. …
The post Other Looks at...
Conditional Border Radius In CSS
5.10.2021
Ahmad Shadeed documents a bonafide CSS trick from the Facebook CSS codebase. The idea is that when an element is the full width of the viewport, it doesn’t have any border-radius. But otherwise, it has 8px of border-radius. …
The post Conditional Border Radius In CSS appeared first...
CSS Border Font
28.2.2021
Every letter in this “font” by Davor Suljic is a single div and drawn only with border. That means employing some trickery like border-radius with exotic syntax like border-radius: 100% 100% 0 0 / 37.5% 37.5% 0 0; which …
The post CSS Border Font appeared first...
Three Ways to Blob with CSS and SVG
19.2.2021
Blobs are the smooth, random, jelly-like shapes that have a whimsical quality and are just plain fun. They can be used as illustration elements and background effects on the web.
So, how are they made? Just crack open an illustration …
The post Three Ways to Blob with CSS and SVG appeared...
What Happens When Border Radii Overlap?
17.8.2020
I’d wager that most times we’re rounding box corners in CSS, we’re applying a uniform border-radius value across the border. It’s a nice touch of polish in many designs. But there are times when we might want different radii for different corners. Easy, right? That way the property takes four...
Animating CSS Width and Height Without the Squish Effect
6.3.2020
The first rule of animating on the web: don't animate width and height. It forces the browser to recalculate a bunch of stuff and it's slow (or "expensive" as they say). If you can get away with it, animating any transform property is faster (and "cheaper").
Butttt, transform can be tricky. Check...
Weekly Platform News: Emoji String Length, Issues with Rounded Buttons, Bundled Exchanges
19.9.2019
In this week's roundup, the string length of two emojis is not always equal, something to consider before making that rounded button, and we may have a new way to share web apps between devices, even when they are offline.
The JavaScript string length of emoji characters
A single rendered emoji...
Various Methods for Expanding a Box While Preserving the Border Radius
6.9.2019
I've recently noticed an interesting change on CodePen: on hovering the pens on the homepage, there's a rectangle with rounded corners expanding in the back.
Expanding box effect on the CodePen homepage.
Being the curious creature that I am, I had to check how this works! Turns out, the rectangle...
Using a PostCSS function to automate your responsive workflow
5.9.2019
A little while back, you might have bumped into this CSS-Tricks article where I described how a mixin can be used to automate responsive font sizes using RFS. In its latest version, v9, RFS is capable of rescaling any value for value for any CSS property with px or rem units, like margin, padding...
Diana Smith’s Top 5 CSS Properties She Uses to Produce CSS Art
20.2.2019
Have you seen Diana Smith's CSS drawings? Stunning. These far transcend the CSS drawings that sort of crudely replicate a flat SVG scene, like I might attempt. We were lucky enough for her to post some of her CSS drawing techniques here last year.
Well, Diana has also listed the top five...
Slice and Dice a Disc with CSS
13.1.2019
I recently came across an interesting sliced disc design. The disc had a diagonal gradient and was split into horizontal slices, offset a bit from left to right. Naturally, I started to think what would the most efficient way of doing it with CSS be.
Sliced gradient disc.
The first thought...
An Initial Implementation of clip-path: path();
24.12.2018
One thing that has long surprised (and saddened) me is that the clip-path property, as awesome as it is, only takes a few values. The circle() and ellipse() functions are nice, but hiding overflows and rounding with border-radius generally helps there already. Perhaps the most useful value...