Email or username:

Password:

Forgot your password?
170 posts total
Bramus

we tend to talk more about the new and latest and greatest in CSS, but i always appreciate a deep-dive into "established" properties, like this one by @chriscoyier

#css #webdev

frontendmasters.com/blog/backg

Bramus

The CSSWG as agreed to publish a first Working Draft for Masonry layout – with the two major proposals merged where possible, and otherwise presented side by side. Most of the differences are syntax only.

Here's the Editor's Draft that will be published:

drafts.csswg.org/css-grid-3/

And the discussion:

github.com/w3c/csswg-drafts/is

#css

Bramus

📢 New post: The State of ES5 on the Web.

For years, we defaulted to transpiling to ES5 in order to support IE. But is that still necessary?

I took a look at the data to find out, and I'll just say that the results were *actually* quite surprising! 🙀

philipwalton.com/articles/the-

Show previous comments
Yoz

@philipwalton Fascinating, thank you for this!

Is it possible that some sites served ES6+ code because they recognised Chrome (which HTTP Archive uses for the crawl) BUT would serve purely ES5 code to (say) IE11?

I've no idea how common this would be in practice, but I remember plenty of recommendations in the past about doing this sort of thing.

Jeroen Engels

@philipwalton Very interesting investigation!

What I feel like I'm missing is how many users are in practice still using browsers without ES2015+ support.

I know @ljharb knows about similar Node.js data, maybe they also know about browser usage?

I otherwise completely agree that the state where websites think they support ES5 browsers but don't is a problem.

Dave Rupert

@philipwalton Do you know of any bundle analysis tooling that covers this ES5/6 gap? I also think about stuff like SVGs that sneak into bundles and tanks performance. Or like Jake's post about a setTimeout in an IFFE. Is there a Lighthouse for bundles?

Most bundle analyzers I see are just tree-graphs, which is helpful but not critical about how much "over-compiled" code has leeched into your build.

Bramus

Got a bug report on emoji-picker-element that it's super slow if you have ~20k custom emoji (some fediverse instances… 😵‍💫). I was about to write some complex virtualization logic until I remembered that `content-visibility` exists: web.dev/articles/content-visib

~15% perf boost in Chrome, ~5% in Firefox, Safari has it in Tech Preview I guess. And no accessibility pitfalls or complicated code to maintain. Not as good as virtualization, but amazing what a few lines of CSS can do. github.com/nolanlawson/emoji-p

Got a bug report on emoji-picker-element that it's super slow if you have ~20k custom emoji (some fediverse instances… 😵‍💫). I was about to write some complex virtualization logic until I remembered that `content-visibility` exists: web.dev/articles/content-visib

~15% perf boost in Chrome, ~5% in Firefox, Safari has it in Tech Preview I guess. And no accessibility pitfalls or complicated code to maintain. Not as good as virtualization, but amazing what a few lines of CSS can do.

Nolan Lawson

Working on an additional PR now that adds a _bit_ more complexity but gains a ~15% perf boost in Chrome and ~36% in Firefox. It relies on detecting when the `content-visibility: auto` state changes and using the old `<img data-src>` trick to set the `src` in that case. github.com/nolanlawson/emoji-p

A bit of extra code, but still not as gnarly as a full virtual list!

Bramus

📝 New post: I wrote about the Performance Monitor panel in Dev Tools (which I didn't know existed even though I use Dev Tools every day) and it helped me debug a big performance issue.

daverupert.com/2024/09/dev-too

Bramus

Simply add a name attribute with the same value to all participating <details> elements and you're all set ... it's _that_ easy! 🤩

Learn all about it here: developer.chrome.com/docs/css-

I've also included a small polyfill for older browsers in the post.
mas.to/@patrickbrosset/1130903

Chris Ferdinandi ⚓️

@bramus Were the accessibility concerns around auto-closing elements that were raised during the spec process ever addressed? I don't see anything about that here.

Ben Keith

@bramus Is there a way to turn the exclusivity off? Many sites will use accordions instead of headings, with the effect that it becomes impossible to search or skim the page without reverting to viewing source.

Bramus

PSA: If your GitHub Actions just started breaking today, check that you aren't affected by this breaking change in the "upload-artifact" action. It took a lot of digging for me to realize that was the culprit; they decided to ship a change that excluded "hidden" files/dirs (anything starting with a dot, including our .vite asset manifest) as a security measure to avoid leaked credentials. People are pretty pissed about this, because it 100% should've been a 5.x semver release with a change that huge, and it broke a few hundred repos at least.

Anyway, the fix is to include, in your YML for that action, include-hidden-files: true

PSA: If your GitHub Actions just started breaking today, check that you aren't affected by this breaking change in the "upload-artifact" action. It took a lot of digging for me to realize that was the culprit; they decided to ship a change that excluded "hidden" files/dirs (anything starting with a dot, including our .vite asset manifest) as a security measure to avoid leaked credentials. People are pretty pissed about this, because it 100% should've been a 5.x semver release with a change that huge,...

Show previous comments
Philip Gillißen

@SilverEagle last time they broke it for good and it was the v4 upgrade. That was painful, but a non major semver upgrade? Evil especially as they always recommend to only use the major version tag

Brian Muenzenmeyer

@SilverEagle I'll never understand why people are so worried about incrementing semver. It's a number. It communicates caution. Big miss on this.

Bramus

👀 There's some interesting movement happening in WebKit wrt Scroll-Driven Animations … bugs.webkit.org/show_bug.cgi?i

Bramus

And the next one related to scroll-driven animations got fixed: bugs.webkit.org/show_bug.cgi?i

IT'S HAPPENING, PEOPLE! 🤩

Get prepared for it now, by checking out scroll-driven-animations.style for demos and a free video course!

Bramus

Just a wee reminder that "global support percentages" for browser features mean literally nothing other than fun dinner party conversation.

What matters is the support percentages for the people visiting your website, which are unique to your website, and differ from website to website for all sorts of reasons.

Chris Coyier

You should see the IE 11 traffic on my website ie11fanclub.international

Zach Leatherman :11ty:

@chriscoyier (and even then support percentages are heavily influenced by survivorship bias)

Bramus

My excitement for Safari 18 including support for Style Queries faded a little after hitting webkit.org/b/271040 today.

Turns out Style Queries that target `body` don’t work in WebKit/Safari for some reason.

Bramus

**The Over-Easy Machine**

- UI layering with `anchor()`
- no more complex `position: absolute`
- keyword alignment
- intrinsically sized based on content
- pairs radically with `popover` elements

**Watch**
youtube.com/watch?v=ASb9vO3ARH

nerdy.dev/the-over-easy-mini-w

the over-easy machine from mini web machines
Adam Argyle

little teaser of some of the demo's 🙂

Darin Senneff

@argyleink Adam, is there a way for the popover to shift left/right if it extends outside the viewport edge? I see how to flip it when vertical scrolling, but what if the viewport narrows and the inline edges of the popover now touch the sides?

Bramus

Tell me you haven’t been paying attention to CSS for the past decade+ without telling me 🙃

v0 billboard, via @jaredpalmer on X
Show previous comments
tsia

@bramus also what is that logo? How do I type that domain?

j5v

@bramus
`<center>&lt;div&gt;</center>`
like it's 1999,

and suffer the red syntax highlighting of deprecated tags.

Max Böck

@bramus I know this isn't real but hooo boy is it *on brand* for vercel

Bramus

I scratched my own itch (again) and built a #caniuse CLI tool.

It differs from other attempts at this by also integrating @MDN’s browser-compat-data + collapsing the releases in the table (just like the website does).

⌨️ npm i -g @bramus/caniuse-cli
🔗 github.com/bramus/caniuse-cli

Output for `caniuse viewport-units`
Output for `caniuse @property`
Bramus

The Servo team landed an incredible amount of work and Flexbox is now on by default!

While there's still work to do, this is a huge milestone for Servo! Check out the before & after of the servo.org website below!

On the left is a screenshot of the servo.org website with flexbox disabled. The layout of the page is stacked in rows. On the right, Flexbox is enabled and the site is a combination of columns and rows.
Bramus

Oh no! Apparently “Unsplash Source” – which allowed you to get a random photo from @unsplash – got sunset 😢

unsplash.com/documentation/cha

If your demos – like mine often do – rely on it, go give them an update!

Easiest fix is to swap out Unsplash Source for picsum.photos/.

Adam Argyle

all I'm doing is taking the contents of the <pre> and calling document.startViewTransition() before I inject the authored styles, browser does the rest

Bramus

I must say that CSS nesting, `light-dark()`, relative color format and `@property` are really changing how I'm writing CSS, and how much more maintainable and elegant such code looks like now!

#CSSRenaissance

Sören Hentzschel

@nicolaschevobbe I agree that there is some good stuff. I'm not a big fan of light-dark(), though. I prefer to have CSS variables named by purpose and then override them for dark mode.

Bramus

Oh my word CSS is freaking amazing, coming soon to all browsers anchor-positioning.

This demo has ZERO JS and uses `anchor-positioning` and `popover`

codepen.io/CodeRedDigital/pen/

Vadim Makeev

@dletorey Hmm, it only properly works for me in Chrome Canary 130 and doesn’t fully work in Chrome 128.

A popover is positioned at the bottom of the page, not next to the icon that opened it.
Thomas

@dletorey Not related to the awesome part I’m very much looking forward to, but doesn’t placing interactive elements inside a label have all kinds of weird side effects?

Bramus

Uhoh!

Turns out registering a custom property with the syntax "<string>" doesn’t actually work in Chrome ≤129 nor Safari ≤17.6.

codepen.io/bramus/pen/dyBgJNY

Thankfully it’s fixed in all current preview releases.

Workaround: register the prop as "*", which also accepts strings.

Go Up