CSS by T. Afif's Avatar

CSS by T. Afif

@css-only.dev

CSS stuff by Temani Afif (https://support.temani-afif.com) πŸ’‘ https://css-tip.com 🧩 https://css-shape.com πŸ’« https://css-loaders.com πŸ“ https://css-articles.com βš™οΈ https://css-generators.com 🧱 https://css-pattern.com 🎨 https://css-only.art

6,448
Followers
84
Following
785
Posts
01.05.2023
Joined
Posts Following

Latest posts by CSS by T. Afif @css-only.dev

We need a "Mad CSS Working Group" edition 😁

07.03.2026 09:04 πŸ‘ 9 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0
Video thumbnail

codepen.io/beta

06.03.2026 20:15 πŸ‘ 80 πŸ” 22 πŸ’¬ 3 πŸ“Œ 7
Video thumbnail

border-shape is going to be a lot of fun! πŸ‘€

Stay tuned ...

06.03.2026 19:04 πŸ‘ 74 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0
Video thumbnail

Amazing how we went from not being able to style selects, to doing things like this with them codepen.io/editor/cbols... (and this codepen.io/t_afif/pen/P...)

06.03.2026 13:18 πŸ‘ 116 πŸ” 17 πŸ’¬ 8 πŸ“Œ 2

Here is a @codepen.io demo to compare the shape() implementation with the corner-shape one. Very close to each other.

codepen.io/t_afif/pen/K...

05.03.2026 18:27 πŸ‘ 15 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

a CSS-only idea? 🧐

05.03.2026 21:18 πŸ‘ 1 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Here is a @codepen.io demo to compare the shape() implementation with the corner-shape one. Very close to each other.

codepen.io/t_afif/pen/K...

05.03.2026 18:27 πŸ‘ 15 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0
Preview
The Different Ways to Select <html> in CSS | CSS-Tricks Sure, we can select the <html> element in CSS with, you know, a simple element selector, html. But what other (trivial and perhaps useless) ways can we do it?

How many ways can you select <html> in CSS? @dxnny.fun says β€œchallenge accepted” building off an exercise @css-only.dev did a little while back.

css-tricks.com/the-differen...

css-tip.com/root-selecto...

05.03.2026 14:05 πŸ‘ 10 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0

It appears that I accidentally implemented the Squircle shape with my new generator! πŸ‘€

I extracted the code and added a variable to easily control the radius.

css-tip.com/squircle/

05.03.2026 11:12 πŸ‘ 8 πŸ” 0 πŸ’¬ 0 πŸ“Œ 1

minimal demo: codepen.io/t_afif/pen/G...

Body and tooltip are inside the same containing block , body has relative and tooltip fixed so tooltip is laid out after so at the end the anchor is laid out before and it works.

04.03.2026 23:12 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

If your anchor is having pos: absolute and is after the Tooltip, then it's dead ... The only solution in this case (a crazy one) is to make the tooltip have pos: fixed and body have pos: relative so you trap the anchor inside a containing block (body) and tooltip is outside of it.

04.03.2026 23:10 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

Demo: codepen.io/t_afif/full/... via @codepen.io

04.03.2026 09:14 πŸ‘ 9 πŸ” 4 πŸ’¬ 0 πŸ“Œ 0
Video thumbnail

To celebrate the new "border-shape" property being tested in @developer.chrome.com I made a nice little tool for helping you generate CSS shape functions.

Try it here:

ailab.nordcraft.site/pen-tool

04.03.2026 14:29 πŸ‘ 22 πŸ” 3 πŸ’¬ 3 πŸ“Œ 0

Demo: codepen.io/t_afif/full/... via @codepen.io

04.03.2026 09:14 πŸ‘ 9 πŸ” 4 πŸ’¬ 0 πŸ“Œ 0

Something to play with.

03.03.2026 16:23 πŸ‘ 2 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

And it's live!

A new CSS generator for fancy frames (Squiggly, Ragged, Wavy, Torn, etc.). Powered by shape() and ready for border-shape as well!

css-generators.com/fancy-frame/

It's responsive and works with any elements, including images.

Play with the settings and show me your best frame πŸ‘‡

03.03.2026 14:02 πŸ‘ 32 πŸ” 4 πŸ’¬ 1 πŸ“Œ 4

And it's live!

A new CSS generator for fancy frames (Squiggly, Ragged, Wavy, Torn, etc.). Powered by shape() and ready for border-shape as well!

css-generators.com/fancy-frame/

It's responsive and works with any elements, including images.

Play with the settings and show me your best frame πŸ‘‡

03.03.2026 14:02 πŸ‘ 32 πŸ” 4 πŸ’¬ 1 πŸ“Œ 4

Now that's what I call a select demo.

03.03.2026 10:43 πŸ‘ 18 πŸ” 2 πŸ’¬ 1 πŸ“Œ 0

Don't give me such ideas πŸ˜†

03.03.2026 10:37 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

This is the kind of content I’m here for πŸ˜‚

03.03.2026 01:59 πŸ‘ 36 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0

I already predicted this gonna happen πŸ˜…

I listed/detailed all the tricky cases and why they happen (and how to fix them when possible) πŸ‘‡

bsky.app/profile/css-...

02.03.2026 22:34 πŸ‘ 6 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

It's a good time to read my four-part series. A lot of tricks and cool examples!

css-tricks.com/better-css-s...

02.03.2026 20:44 πŸ‘ 23 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

this is hilarious.

You SAID we could style <select> now DAD.

02.03.2026 16:40 πŸ‘ 54 πŸ” 5 πŸ’¬ 0 πŸ“Œ 0

give me randomness and I will give you different guns, different targets, different everything 🀩

02.03.2026 17:58 πŸ‘ 8 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Video thumbnail

It seems we can now customize the select element, right? right?!

Demo: codepen.io/t_afif/pen/P... via @codepen.io

02.03.2026 13:44 πŸ‘ 369 πŸ” 82 πŸ’¬ 11 πŸ“Œ 13
Preview
10 Cool CodePen demos 10 Cool CodePen demos from February 2026

10 Cool Codepen Demos: February 2026
alvaromontoro.com/10-cool-code...

3D animations, particles with Three.js, shaders, color pickers, games, impressive graphs with CSS... and more!

#webdev #javascript #html #css #codepen

01.03.2026 18:49 πŸ‘ 6 πŸ” 2 πŸ’¬ 0 πŸ“Œ 0
Video thumbnail

Another custom select list using using appearance: base-select.

On browsers that don't yet support this, a normal select list will be displayed.

See the full demo on @codepen.io codepen.io/cbolson/pen/...

28.02.2026 11:43 πŸ‘ 40 πŸ” 5 πŸ’¬ 3 πŸ“Œ 1

At this point, all the shapes get crazy πŸ˜†

01.03.2026 13:33 πŸ‘ 0 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

"jagged" is not bad but looking at the description it seems for spiky, sharp stuff while in my case, it's soft and wavy. Maybe "ragged" or 'torn" is better in this case.

01.03.2026 13:22 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

Too many words I don't know πŸ˜…

01.03.2026 13:11 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0