Sign in

CSS by T. Afif

@css-only.dev
6.9K followers 95 following 1.1K posts

CSS stuff by Temani Afif (support.temani-afif.com) 💡 css-tip.com 🧩 css-shape.com 💫 css-loaders.com 📝 css-articles.com ⚙️ css-generators.com 🧱 css-pattern.com 🎨 css-only.art

PostsRepliesMedia
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 29/09/2026
💡 CSS Tip! Want to know how many children your container has? We don't have children-count() yet, but we can implement it using modern CSS! css-tip.com/children-cou... A hacky experiment powered by Scroll-Driven Animations. How would you use it? Share your use cases 👇
There is no important content in this image; I just need an image to make the post look nicer.
1131
CSS by T. Afif @css-only.dev · 29/09/2026
💡 CSS Tip! Want to know how many children your container has? We don't have children-count() yet, but we can implement it using modern CSS! css-tip.com/children-cou... A hacky experiment powered by Scroll-Driven Animations. How would you use it? Share your use cases 👇
There is no important content in this image; I just need an image to make the post look nicer.
1131
CSS by T. Afif @css-only.dev · 26/09/2026
a11y question: Let's suppose I have an empty html element somewhere on the page with 0 content, invisible, having position:absolute (or fixed). It has no purpose in the HTML (only used for some CSS stuff). Is it a good idea to add the "inert" attribute? Or should I do nothing?
210
Reposted by CSS by T. Afif
Bramus @bram.us · 25/09/2026
The time to ramp up your scroll-driven animations skills is **NOW** Go check scroll-driven-animations.style for and free 10-part video course created by yours truly, as well as a bunch of tools and demos.
scroll-driven-animations.style
Scroll-driven Animations
A bunch of demos and tools to show off Scroll-driven Animations
311220
Reposted by CSS by T. Afif
Patrick Brosset @patrickbrosset.com · 24/09/2026
The call for Interop 2027 proposals is closing today. More than 100 proposals got created! Here are my favs 🤩 patrickbrosset.com/lab/interop-... Check them out!
40 colored squares with my favorite feature names.
2218
CSS by T. Afif @css-only.dev · 22/09/2026
💡CSS Tip! Creating CSS Shapes is one of my favorite tasks, and now I can do something even better: Random CSS Shapes! Let's start with Blobs. css-tip.com/random-blob/ You never see the same shape twice. A unique shape for a unique experience! 👀
1344
Reposted by CSS by T. Afif
Amit Sheen @amitsheen.bsky.social · 21/09/2026
Bounce! 🏐 (CSS only) Live demo @codepen.io: codepen.io/editor/amit_...
3293
CSS by T. Afif @css-only.dev · 21/09/2026
I thought it was finally time to play with random until I found out that random-item() is not included and there is no support for the "by X" argument. I need the full package for my crazy ideas 😖
171
Reposted by CSS by T. Afif
Jane Ori 💚 CSS Runner 👩‍💻 @janeori.propjockey.io · 19/09/2026
This is as close to a cry for help that you'd see from me. I need work. I need money for shelter and food in the meantime. I've run out.
14435
Reposted by CSS by T. Afif
Geoff Graham @geoffgraham.me · 18/09/2026
The Front-End Community is Still Alive and Beautiful I thought about dropping an addendum into my last post to say just how overwhelmed I am, in the best possible way, by the way all of you in the... geoffgraham.me/the-front-end-commun…
geoffgraham.me
The Front-End Community is Still Alive and Beautiful
I thought about dropping an addendum into my last post to say just how overwhelmed I am, in the best possible way, by the way all of you in the front-end community have shown up to show support, both for me and for CSS-Tricks. I started to do that but then felt a new post...
111028
CSS by T. Afif @css-only.dev · 18/09/2026
border-shape is leading the votes with 181 thumbs up right now! 👀 Can we do the same for if()? Go vote for it as well: github.com/web-platform... Let's make it part of Interop 2027!
github.com
CSS if() function · Issue #1343 · web-platform-tests/interop
Description The CSS if() function allows devs to use conditional logic to set property values. This feature has shipped in Chrome 137, with some level of development happening in Firefox and Safari...
010
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 16/09/2026
📝 New CSS Article! Learn how I used Scroll-Driven Animations and other modern features to extract various information from a CSS grid. blog.master.dev/extracting-g... Another article to show that CSS is more than a simple set of properties/values.
blog.master.dev
Extracting Grid Information Using CSS
It's an interesting and potentially useful trick to have an element know where it is on a grid. That's tricky enough when the items are in one row/column, but what about when they span?
0445
CSS by T. Afif @css-only.dev · 17/09/2026
💡 CSS Tip! border-shape + border-area = The perfect combo 🪄 3 lines of code to create border-only shapes with gradient coloration. Absolutely any shapes, even the most complex ones! 👀 css-tip.com/gradient-sha... Save the code for the future (a near future!)
Overview of the CSS code from the linked postBorder-only shapes with gradient coloration
1243
CSS by T. Afif @css-only.dev · 16/09/2026
📝 New CSS Article! Learn how I used Scroll-Driven Animations and other modern features to extract various information from a CSS grid. blog.master.dev/extracting-g... Another article to show that CSS is more than a simple set of properties/values.
blog.master.dev
Extracting Grid Information Using CSS
It's an interesting and potentially useful trick to have an element know where it is on a grid. That's tricky enough when the items are in one row/column, but what about when they span?
0445
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 15/09/2026
We should have been writing articles and having fun with CSS, but instead... We can't do much against big corporations (except wait), so let's give Geoff some support. Share (or try) his HTML/CSS course: thebasics.dev 100% human-made by the one who edited 86945 CSS articles!
Screenshot of the provided link
06624
CSS by T. Afif @css-only.dev · 15/09/2026
We should have been writing articles and having fun with CSS, but instead... We can't do much against big corporations (except wait), so let's give Geoff some support. Share (or try) his HTML/CSS course: thebasics.dev 100% human-made by the one who edited 86945 CSS articles!
Screenshot of the provided link
06624
Reposted by CSS by T. Afif
Chris Coyier @chriscoyier.net · 15/09/2026
Boooo. I did try and get it back once. I wonder if we could still make that work. chriscoyier.net/2024/02/28/w... I’m down to find a win-win situation, DO. Call me. 🤙
chriscoyier.net
Where I’m at on the whole CSS-Tricks thing
It was March 2022 when I sold CSS-Tricks to DigitalOcean. So it’s been just about 2 years now. This was me and my wife’s thinking: The negotiated sale price was fair. They are a big com…
39510
Reposted by CSS by T. Afif
Geoff Graham @geoffgraham.me · 14/09/2026
📝 Why CSS-Tricks Has Been Quiet Lately (cc: @digitalocean.com @css-tricks.bsky.social ) geoffgraham.me/why-css-tric...
geoffgraham.me
Why CSS-Tricks Has Been Quiet Lately - Geoff Graham
Because I haven't published anything to it since August 31. And no one else has either. That's not a super long time to go silent but it is for a site that
811330
Reposted by CSS by T. Afif
Maikel Krause @maikelkrause.bsky.social · 01/09/2026
#CSS `progress()` is now baseline! 🥳 I was trying to see if this could be used as a workaround for the lack of typed arithmetic (unit division) in Firefox, and it does work, sort of. codepen.io/editor/maike... (And yes I know there's already the `tan2(atan())` trick, but that has its own bugs.)
codepen.io
CSS typed arithmetic using progress()
A code demo by Maikel Krause created on CodePen
1124
Reposted by CSS by T. Afif
Shaw @shaw.city · 12/09/2026
Oops. I invented a new CSS shrink-wrap technique and blogged about it. blog.codepen.io/2026/09/11/s...
blog.codepen.io
Shrink-wrap Text with `position-anchor`
Normal text wrapping can leave big gaps in your container, which can become even more exaggerated with the new-ish CSS values of text-wrap: balance and text-wrap: pretty. You almost certainly want …
69116
CSS by T. Afif @css-only.dev · 11/09/2026
It's not a competition, but border-shape is actually the second most upvoted feature, close to 100 thumbs up! Can we make it the first?! 👀 Cast your vote 👇
Screenshot of the proposed feature for Interop 2027
141
Reposted by CSS by T. Afif
Patrick Brosset @patrickbrosset.com · 11/09/2026
Interop 2027 prep is now. Want to help? 1. Go to developer-signals.rviscomi.workers.dev 2. Sign-in using GitHub 3. Find features you need 4. Click the comment icon, add your use case 5. Submit There aren't many ways to tell browsers what you need and why you need them. That's a very effective one.
The website, showing a list of web features and a search tool. The title says Shape what browsers build next. The github sign-in button is highlighted as step 1. The speech bubble icon on one of the features is highlighted as step 2.The website, a feature has been selected, and the Provide developer signal dialog is displayed. The use case text input field is highlighted as step 3. The workaround text input field is highlighted as optional. And the submit button is highlighted as step 4.
32311
Reposted by CSS by T. Afif
Ben Evans @ivorjetski.bsky.social · 10/09/2026
It's the 2026 LED ART CSS Challenge! 🥳 I've created an LED experiment... Do something cool! The most creative and maddest will feature in my next YouTube. Your time starts now... youtube.com/watch?v=wHcJ... codepen.io/editor/ivorj...
youtube.com
CSS LED ART CHALLENGE!
YouTube video by Ben Evans
1126
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 08/09/2026
Go vote for the border-shape feature. It should be part of Interop 2027! I have a lot of cool demos waiting for better browser support (that I will share anyway in 2026 😅) github.com/web-platform...
github.com
CSS ` border-shape` · Issue #1371 · web-platform-tests/interop
Description CSS border-shape (CSS Borders and Box Decorations Module Level 4) lets authors define an element’s border geometry using values (circle(), ellipse(), polygon(), inset(), shape(), path()...
3227
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 09/09/2026
Ready for another CSS-only diagram? This time, I am trying another connector type. It sticks to the selected sides, regardless of the node's position. css-tip.com/node-connect... Look how the lines get distorted! 👀 Another cool demo powered by border-shape, anchor position, and more!
3338
CSS by T. Afif @css-only.dev · 09/09/2026
Ready for another CSS-only diagram? This time, I am trying another connector type. It sticks to the selected sides, regardless of the node's position. css-tip.com/node-connect... Look how the lines get distorted! 👀 Another cool demo powered by border-shape, anchor position, and more!
3338
Reposted by CSS by T. Afif
Sanne Peters @sanstream.eurosky.social · 08/09/2026
#dataviz people who make things for the web, go vote for this! Border-shape opens the door to using html elements instead of svg elements to render shapes. In turn opening the door to making data-visualisations a lot more accessible.
093
Reposted by CSS by T. Afif
Josh W. Comeau @joshwcomeau.com · 08/09/2026
I've been using border-shape a ton for an Electron project I'm working on and it's just the best thing ever. Well worth a vote!
2373
CSS by T. Afif @css-only.dev · 08/09/2026
Go vote for the border-shape feature. It should be part of Interop 2027! I have a lot of cool demos waiting for better browser support (that I will share anyway in 2026 😅) github.com/web-platform...
github.com
CSS ` border-shape` · Issue #1371 · web-platform-tests/interop
Description CSS border-shape (CSS Borders and Box Decorations Module Level 4) lets authors define an element’s border geometry using values (circle(), ellipse(), polygon(), inset(), shape(), path()...
3227
Reposted by CSS by T. Afif
Patrick Brosset @patrickbrosset.com · 04/09/2026
Haha yeah. Well the list is here at least: web-platform-dx.github.io/web-features...
web-platform-dx.github.io
Web features explorer - Limited availability
Use the web features explorer to discover new features and APIs and stay up-to-date with changes.
141
CSS by T. Afif @css-only.dev · 03/09/2026
It's always nice to see some of your code getting better support 🤩 A nice use case of attr() is styling the native progress element by getting the progress value to do various calculations css-tip.com/custom-progr...
Overview of the CSS code from the linked post4 custom progress element with fancy coloration
0152
CSS by T. Afif @css-only.dev · 02/09/2026
Combining the content property with if() is pretty handy for conditionally displaying information. If an element spans one column or one row, don't show the "end" value
Showing the CSS code that display the grid information within a grid item
0130
CSS by T. Afif @css-only.dev · 01/09/2026
Yes, it's responsive. All the values are updated on screen/container resize! Demo: codepen.io/t_afif/full/... via @codepen.io
060
CSS by T. Afif @css-only.dev · 01/09/2026
Getting information from a simple grid is good, but what about a complex one where the items are randomly placed? 👀 css-tip.com/grid-informa... A fancy demo powered by Scroll-Driven Animations and more! All the values are calculated and displayed using only CSS.
A grid of randomly placed items where each one show its own position within the grid
2220
CSS by T. Afif @css-only.dev · 31/08/2026
I think we missed the opportunity to call it "grid-col" instead of "grid-column" to have ... better-written code and avoid adding extra spaces to align it with "grid-row" I know I am not alone in the side quest of having the values as aligned as possible 🙃
The following CSS code:
.item {
  grid-col: 5;
  grid-row: 2;
  
  /* instead of */
  grid-column: 5; 
  grid-row:    2;     
}
2312
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 26/08/2026
📝 New CSS Article! Do you want to know how I made that cool hover effect? Read my latest article 👇 blog.master.dev/hover-proxim... I am showing you what programming* with CSS looks like when you combine the modern features! *yes, I said the forbidden word
blog.master.dev
Hover Proximity Using Modern CSS
You can always easily style :hover, but what if you want the NEXT item to have styling too? Or, just a smidge harder, the PREVIOUS item. How about multiple in any direction?
0307
Reposted by CSS by T. Afif
Ana Tudor @anatudor.bsky.social · 27/08/2026
Yesterday, I posted a demo for all, showing a multi-layer wave header, #CSS only, no SVG, no extra elems just for the visual result codepen.io/thebabydino/... Today, a massive article about the Maths & CSS behind for Cheetah+ supporters ❇️ ko-fi.com/post/Wave-he... ❇️ www.patreon.com/anatudor/pos...
Demo screenshot. Shows a header with a wavy bottom edge.
185
CSS by T. Afif @css-only.dev · 26/08/2026
📝 New CSS Article! Do you want to know how I made that cool hover effect? Read my latest article 👇 blog.master.dev/hover-proxim... I am showing you what programming* with CSS looks like when you combine the modern features! *yes, I said the forbidden word
blog.master.dev
Hover Proximity Using Modern CSS
You can always easily style :hover, but what if you want the NEXT item to have styling too? Or, just a smidge harder, the PREVIOUS item. How about multiple in any direction?
0307
Reposted by CSS by T. Afif
Ahmad Shadeed @ishadeed.com · 25/08/2026
✍️ New Article: Balancing flex items with flex-wrap: balance I explored flex-wrap: balance and flex-line-count and really enjoyed using them. I even made a masonry layout by mixing flex-line-count, round, clamp, and container queries units! 😀 ishadeed.com/article/flex...
ishadeed.com
Balancing flex items with flex-wrap: balance
A look at how flex items wrap and how to balance them across lines.
36111
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 24/08/2026
Did anyone already mention "Dark mode with spotLight"? No!? That's the only valid way. Demo: codepen.io/t_afif/pen/Y... via @codepen.io Debating about toggles? Well, I don't understand ...
1678
CSS by T. Afif @css-only.dev · 24/08/2026
Did anyone already mention "Dark mode with spotLight"? No!? That's the only valid way. Demo: codepen.io/t_afif/pen/Y... via @codepen.io Debating about toggles? Well, I don't understand ...
1678
CSS by T. Afif @css-only.dev · 21/08/2026
Targeting the elements of the same row and same column; a classic. Demo: codepen.io/t_afif/full/... via @codepen.io
0102
Reposted by CSS by T. Afif
Stefan Judis @stefanjudis.com · 21/08/2026
Here's Temani yet again doing Temani things explaining how to tweak and adjust the overflow of individual images using `object-fit` and `object-position`. It's a great read to understand `img` fundamentals. master.dev/blog...
A container with a red border showing that an image can overflow.
0104
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 19/08/2026
And because no one will remember all the weird values, I made a small generator to get the code in no time. css-tip.com/text-box/
1529
CSS by T. Afif @css-only.dev · 20/08/2026
Move away, give me some space to grow! Demo: codepen.io/t_afif/full/... via @codepen.io
0100
CSS by T. Afif @css-only.dev · 19/08/2026
And because no one will remember all the weird values, I made a small generator to get the code in no time. css-tip.com/text-box/
1529
CSS by T. Afif @css-only.dev · 19/08/2026
A responsive CSS grid, some Scroll-Driven Animations, and a touch of magic. The perfect recipe for a cool CSS-only hover effect! 🤩 css-tip.com/hover-proxim... One fancy demo (among many) we can create using modern CSS.
3463
Reposted by CSS by T. Afif
CSS by T. Afif @css-only.dev · 18/08/2026
An interactive demo showing how all the values adjust in real time as the grid is resized. codepen.io/t_afif/full/... via @codepen.io All the values are integers, so you can use counters to display them.
1599
Reposted by CSS by T. Afif
Stefan Judis @stefanjudis.com · 18/08/2026
And the new Web Weekly is going out in a few minutes. 🥂 This time it includes the Git `history` command, Edge's new network efficiency guardrails, CSS gap decorations, and some `img` element magic. Enjoy! webweekly.email/archive/web-...
Web Weekly 198

- object-fit & object-position
- Unblocking view transitions
- Gap decorations
- @keyframes in the cascade
- The experimental history command
- The inert attribute
0164
CSS by T. Afif @css-only.dev · 18/08/2026
An interactive demo showing how all the values adjust in real time as the grid is resized. codepen.io/t_afif/full/... via @codepen.io All the values are integers, so you can use counters to display them.
1599