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,455
Followers
84
Following
791
Posts
01.05.2023
Joined
Posts Following

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

If, like many developers, you struggle to know when to use min() and max(), check this:

css-tip.com/min-max/

A simple trick to help you know which one to use. You no longer need to try both until one of them works.

10.03.2026 18:28 πŸ‘ 38 πŸ” 7 πŸ’¬ 1 πŸ“Œ 0
Web Weekly 186

- Chrome’s new release cycle
- window.stop()
- Trusted Types on the baseline
- <geolocation> style restrictions
- HTML table mysteries
- theme-color in Safari

Web Weekly 186 - Chrome’s new release cycle - window.stop() - Trusted Types on the baseline - <geolocation> style restrictions - HTML table mysteries - theme-color in Safari

The new Web Weekly is about to hit all the inboxes in just a moment! 🫣

If you're into web dev news close to the platform (you know, browser features, specs, and all the good stuff), you should check it out!

webweekly.email/archive/web-...

10.03.2026 19:52 πŸ‘ 15 πŸ” 4 πŸ’¬ 1 πŸ“Œ 0

Three "Temani" in this one! I holding a new record, thanks for the mentionS 😁

btw, the link for the anchor article is wrong. You used the one for the of if() tip.

10.03.2026 20:21 πŸ‘ 0 πŸ” 0 πŸ’¬ 1 πŸ“Œ 0

If, like many developers, you struggle to know when to use min() and max(), check this:

css-tip.com/min-max/

A simple trick to help you know which one to use. You no longer need to try both until one of them works.

10.03.2026 18:28 πŸ‘ 38 πŸ” 7 πŸ’¬ 1 πŸ“Œ 0
Screenshot of my first work featured un the codepen spark

Screenshot of my first work featured un the codepen spark

I still remember my first Spark πŸ˜‡ (That took me weeks to notice and understand why I am getting so many notifications πŸ˜…)

codepen.io/spark/238

10.03.2026 14:35 πŸ‘ 7 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

One day you're like "we should send a weekly newsletter about the cool stuff on @codepen.io and around".

Then 500 weeks go by. πŸŽ‰

codepen.io/spark/500

09.03.2026 19:42 πŸ‘ 57 πŸ” 6 πŸ’¬ 3 πŸ“Œ 1

And I know most of you are looking for the hexagon shape, so in addition to the generator, here is another code with CSS variables to easily control the radius and the rotation.

css-tip.com/rounded-hexa...

Yes, you can have cool hover effects and animations!

09.03.2026 18:30 πŸ‘ 16 πŸ” 1 πŸ’¬ 0 πŸ“Œ 0

Yes, might be a good idea. Will take note of it 😜

09.03.2026 13:40 πŸ‘ 1 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0
Video thumbnail

Now that shape() is available in all major browsers, let me remind you that you can use my online generator to create any polygon with ... rounded corners!

css-generators.com/polygon-shape/

Adjust the setting, then copy the code.

09.03.2026 11:34 πŸ‘ 74 πŸ” 7 πŸ’¬ 2 πŸ“Œ 1

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 πŸ‘ 13 πŸ” 1 πŸ’¬ 0 πŸ“Œ 1

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 πŸ‘ 84 πŸ” 23 πŸ’¬ 4 πŸ“Œ 7
Video thumbnail

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

Stay tuned ...

06.03.2026 19:04 πŸ‘ 73 πŸ” 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 πŸ‘ 118 πŸ” 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 πŸ‘ 16 πŸ” 2 πŸ’¬ 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 πŸ‘ 16 πŸ” 2 πŸ’¬ 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 πŸ‘ 13 πŸ” 1 πŸ’¬ 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 πŸ‘ 2 πŸ” 0 πŸ’¬ 0 πŸ“Œ 0

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

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