Benoit

Benoit

@benoitlaroc.bsky.social

44 followers214 following11 posts

Benoit reposted

🔥 New blog post: Dark mode toggles that expose three states (system, light, dark) seem like the best option. Until you think about user goals, that is. Before rushing to disagree, hear me out. lea.verou.me/blog/2026/da... PS: As a data point, @jakearchibald.com was converted after reading this 😅

lea.verou.meDark mode toggles: two states are enough • Lea VerouYes, the underlying model must have three states, but one is always irrelevant to the actual user goal. Users do not seek out solutions to problems they don’t currently have. A lot of the hate towards...

Benoit reposted

Trimming our #CSS with sibling-index() and sibling-count(): "Small changes like this add up. Replacing repetitive selectors with functions like sibling-index() and sibling-count() makes the code easier to read and maintain, and a little more resilient to change." thoughtbot.com/blog/trimmin...

thoughtbot.comTrimming our CSS with sibling-index() and sibling-count()We’re experimenting with two new CSS functions to clean up our logo marquee code.

Benoit reposted

🚀Do we like scroll-driven animations? yes! Do we want scroll-triggered animations? Also yes! Would it be cool to combine them? Ow hell yes! And that's just what I did in this year's Valentine's article, enjoy! ❤️❤️ It's quite lengthy, but also contains some hot tips 🔥 utilitybend.com/blog/css-ani...

utilitybend.comCSS Animation Triggers: Playing animations on scroll without scrubbing. It's a match! | utilitybendCSS scroll-triggered animations let you use scroll position to determine when animations play. Combined with scroll-driven animations for the perfect scrollytelling experience. A Valentine's special.

Benoit reposted

Benoit reposted

💡 CSS Tip! In Anchor Positioning, you can use position-area to place an element relatively to its anchor, but there are 36 different positions !? 👀 No one can memorize them all, so I've created an interactive demo where you can select a position and get its code. css-tip.com/position-area/

Benoit reposted

With View Transitions now being Baseline Newly available, and the View Transition API consisting of various features, it can be confusing to know what is supported in which browser versions. To help with that, I created this VT Feature Explorer (powered by View Transitions) web.dev/blog/same-do...

Benoit reposted

If you thought we were done with View Transitions, guess again! A feature Chrome is working on, is “Scoped View Transitions”, which allow you to scope a VT to a subtree of the DOM. This unlocks things like concurrent transitions and prevents layering issues. developer.chrome.com/blog/scoped-...

Benoit reposted

Between the time we launched the original Learn CSS course on web.dev and today, container queries landed in browsers and became Baseline Widely available! It was high time for an update, and we were lucky enough to have the team at OddBird work with us. Enjoy 9 new modules! web.dev/blog/learn-c...

web.devA refresh of Learn CSS with nine new modules  |  Blog  |  web.devOur popular Learn CSS course has been updated with new modules covering the latest CSS features.

Benoit reposted

Benoit reposted

transform & opacity If you can do your animations with only these then do it. Others will likely cause the below to happen

Wes Bos@wesbos.com

This is CSS performance problem I see all too often. The React website has some jank due due to their use of transition. Here is how to find what causes it and how and fix it

Benoit reposted

I've somehow only now realized that if you want to transition between themes, view transitions make it incredibly easy... Translates like I did here are a bit over the top, but clip-path opens up some fun possibilities.

Benoit reposted

scroll-target-group is coming to Chrome 140 (stable next month)! Building on CSS carousel APIs, scroll-target-group lets you "enhance" elements into scroll markers, enabling you to build this scroll-spy effect in 2 lines of CSS! Makes for a great progressive enhancement! una.im/scroll-targe...

una.imuna.im | Creating a scroll-spy with 2 lines of CSSscroll-target-group is a new CSS feature that lets you create scroll-spy table of contents with basically 2 lines of CSS.

Benoit reposted

Can you believe this demo uses NO JavaScript!? I'm trying out 2 new web platform features: 1. popover=hint prevents other popovers from closing when opened (landed in Chrome 133) 2. interesttarget to open the comment details on hover/focus (WIP, origin trial, needs work for touchscreen behavior)

Benoit reposted

Replying to @bram.us

You can achieve the `auto` behavior by using the renewed `attr()` function. Unlike `auto`, it can work with any attribute and it’s also less of a footgun (*) www.bram.us/2025/01/20/c... is a demo that uses `attr()` to set the `view-transition-name`s. (*) See github.com/w3ctag/desig... for details.

bram.usCSS attr() gets an upgradeYou can now use `attr()` with any CSS property — not just content – and it can parse values into data types other than <string>.

Benoit reposted

As of Chrome 131 you have more options to style `<details>` and `<summary>`. You can now use of the `display` property on these elements, and also use a `::details-content` pseudo-element to style the part that expands and collapses. developer.chrome.com/blog/styling...

Benoit reposted

#CSS scrollbar-color and scrollbar-gutter are Baseline Newly available: "You can change the colors used for scrollbars, the thumb, and the color track with it. You can opt-in to a narrower scrollbar, or even hide the scrollbar completely without affecting scrollability."

web.devCSS scrollbar-color and scrollbar-gutter are Baseline Newly available  |  Articles  |  web.devCSS scrollbar-color and scrollbar-gutter have landed in all major browser engines, making it Baseline Newly available.

Benoit reposted

The power of view transitions is absolutely mind-boggling. Things like this 👇 are quickly done with some CSS (no hacks!) and no additional DOM elements. Wild! 🤯

Benoit reposted

A "section" without an accessible name is nothing but a "div" - "Explore how to effectively implement the ⁠<section> HTML element with ⁠aria-label for enhanced navigation and landmark roles, ensuring your content is accessible to all users." #a11y https://www.stefanjudis.com/today-i-learned/section…

stefanjudis.comA "section" without an accessible name is nothing but a "div"Explore how to effectively implement the ⁠"section" HTML element with ⁠aria-label for enhanced navigation and landmark roles, ensuring your content is accessible to all users.

Benoit reposted

Benoit reposted

Did you know you can center both vertically and horizontally in CSS now, without Flexbox or Grid? Throw this on your block level element, and it works: align-content: center; justify-items: center; And my trick to remembering it's those properties? It's the ones I never use normally 😆

Benoit reposted

Replying to @erwinhofman.bsky.social

"But Erwin, isn't this just an #SPA?" Nope.. the website is still an MPA, meaning optimal crawlability, accessibility etc. But yes, it does feel like an SPA thanks to ViewTransitions: developer.chrome.com/docs/web-pla... 4/4

developer.chrome.comCross-document view transitions for multi-page applications  |  View Transitions  |  Chrome for DevelopersGet started with cross-document view transitions for use in your multi-page application (MPA).

Benoit reposted

You are up to date.