Email or username:

Password:

Forgot your password?
170 posts total
Bramus

So, umm, we inadvertently broke `linear()`, `cubic-bezier()`, and `steps()` in certain cases in Chrome 128 😬

It’s broken in the case where you have whitespace after the opening `(`

Broken: `linear( 0, 1)`
Not broken: `linear(0, 1)`

issues.chromium.org/issues/361

(It’s only the whitespace after the opening `(` causing issues here. All other whitespace does not affect things, as typically goes in CSS)

Bramus

To see how far this extends, I queried the HTTP archive.

Out of the 559 million “root pages” in the set, about 6k are affected by this – mainly in their usage of `cubic-bezier()`.

While this is very unfortunate, I believe the number of affected sites seems quite reasonable.

At worst the effects on those sites will run using a `linear` timing, instead of the custom one.

The fix is easy too: remove the whitespace.

Bramus

we wont be calling these drop-downs anymore tho, with anchor() auto-flip it…

**might be a drop-up!**

video alt:
4 customized <select> elements shown from Chrome Canary. each has a custom picker flyout, flyout flips to stay in view, keyboard accessibility, and animation

Bramus

Goooooo Scroll-Driven Animations!

I explain the code behind a similar demo in the 7th episode of my free “Unleash the Power of Scroll-Driven Animations” video course.

🎬 scroll-driven-animations.style

Go check out the full course and become an expert in Scroll-Driven Animations 🤩
mastodon.social/@anatudor/1130

Bramus

Goooooo Scroll-Driven Animations!

I explain the code behind a similar demo in the 7th episode of my free “Unleash the Power of Scroll-Driven Animations” video course.

🎬 scroll-driven-animations.style

Go check out the full course and become an expert in Scroll-Driven Animations 🤩
mastodon.social/@anatudor/1130

Bramus

🙌🏻 WebKit have indicated a positive support position on the new Invoker Commands API (unless anything unexpected crops up in the next week) [1].

If you’re wondering what this #WebPlatform API is, I recorded a 5 minute video a few weeks back: youtu.be/AY6BMht28qg

[1]: github.com/WebKit/standards-po

Bramus

I blug about #css again. Preventing an `!important` user agent style from kicking in with an infinite-duration transition noahliebman.net/2024/08/beatin

```css
input {
  /* prevent anything that tries to change this from ever getting there */
  transition:
    color calc(infinity * 1s) step-end,
    background-color calc(infinity * 1s) step-end;

  /* style the field as normal */
  background-color: transparent;
  color: CanvasText;
}
```
Show previous comments
Amadeus Maximilian

@noleli I’m assuming this works, because the user specified styles get applied first, because the !important of the user agent stylesheet makes it kick in last? And that’s how the initial state of the transition is set?

I never thought of !important styles being applied *after* regular ones in a “time” sense. 😅

meduz'

@noleli Ha ha ha, super nice trick. I didn’t know about `infinity` for CSS transition.

lencioni

@noleli would it be a bit cleaner to set the transition-delay to infinity instead of the transition-duration? Of course the result should be the same but that would remove the need to specify the timing function I think.

Bramus

This hammer is terrible at drilling holes therefore the very idea of tools is silly.

Mark Pesce

@johnallsopp I FEEL AS THOUGH THE STONE HAND AXE IS A BAD IDEA JOHN CAN WE PLEASE STOP WITH ALL THAT PALEOLITHIC NONSENSE

Bramus

Day 109: the animation-composition property

CSS animations can be composited in three ways: replace, add, and accumulate. The animation-composition property allows you to switch between them.

#100DaysOfMoreOrLessModernCSS

matuzo.at/blog/2024/100daysof-

Bramus

Starting with version 128, Chrome and Edge now have an implementation of document.caretPositionFromPoint!

Docs: developer.mozilla.org/en-US/do

Very useful for web text editors, especially when working with Shadow DOM.
This was one of the most requested Chromium features, and was proposed for Interop 24 (sadly not accepted).

We only need Safari now for it to become Baseline!

Bramus

@MerriNet Checked this in detail and while it does work, it doesn’t seem to play nice in situations where the scroller goes from non-overflowing to an overflowing state (which could be considered a bug).

Also a pity that it requires an element (or generated content) that actually takes up space (i.e. `min-height: 1px`).

And finally no Safari support for this, unfortunately :-(

codepen.io/bramus/pen/GRbxOPX/

Bramus

New in @ChromeDevTools (in Chrome Canary): You can now force more states – such as :active, :focus, … – onto elements.

For example, when inspecting an <input> element you can now also force states such as :enabled, :valid, etc.

Screenshot of Chrome DevTools, showing extra states that can be toggled on the selected &lt;input&gt;
Bramus

These extra states depend on the context. When inspecting a <label> element, you get different options than when inspecting <input>.

Screenshot of Chrome DevTools, showing extra states that can be toggled on the selected &lt;label&gt;
Roma Komarov

@bramus can we also have an ability for the emulated states like hover or focus to propagate to the parents? Very often I want to apply :hover on dive element, and it trigger all the :hover on all the ancestral events. Same for :focus-within triggering for focus/focus-visible.

Show previous comments
Nicolas Hoizey

@grooovinger @bramus it doesn't seem to work in Firefox unfortunately.

Based on Can I Use, `scroll-snap-type` and `scroll-snap-align` are supported, but maybe not these values?

Amadeus Maximilian

@grooovinger @bramus as cool as this is, I think this also breaks inertia scroll on iOS. 🤔 Thanks for building it though, I was curious to implement it myself when I tread the original Toot. 😊

I feel like I’ve read about a similar solution using overflow-anchor somewhere, but I might be mistaken, since that property doesn’t do what I thought it did. 😅

Bramus

Today I saw this React hook (see photo) get shared on birdsite. It enables one to “automatically scroll down when new messages arrive in a chat”.

While it might work, you could — and should — use this little bit of CSS instead:

```
.log {
scroll-snap-type: y proximity;
align-content: end;
}
.log::after {
display: block;
content: "";
scroll-snap-align: end;
}
```

“… remains snapped to the bottom …unless the user has scrolled away from that edge” — drafts.csswg.org/css-scroll-sn

Today I saw this React hook (see photo) get shared on birdsite. It enables one to “automatically scroll down when new messages arrive in a chat”.

While it might work, you could — and should — use this little bit of CSS instead:

```
.log {
scroll-snap-type: y proximity;
align-content: end;
}
.log::after {
display: block;
content: "";
scroll-snap-align: end;
}
```

The React Hook that was shared.
Show previous comments
Kit Henry

@bramus how does this compare to using `flex-direction: column-reverse;`?

andrei!

@bramus Thank you this is amazingly simple.

Juan Villela

@bramus My favorite part of the hook is the lack of comments 🙃

Bramus

👀 Apple/WebKit about to express support for cross-document View Transitions (and related features such pageswap, pagereveal, render blocking) + also View Transition Types.

github.com/WebKit/standards-po

Get the rundown of these features here: developer.chrome.com/blog/view (video included)

Bramus

You can capture CSS selector stats and identify slow selectors in the Performance panel! #chromedevtools #css #webperformance

Bramus

this is one of the most fascinating deep dive rabbit hole articles i've read in a long time. my brain melted but omg so fascinating
dgerrells.com/blog/how-not-to-

Anisha Latchman

@paul Hi Paul! I created a short (3:38) application video (youtu.be/iu5RnX47Ebg) to express my excitement for developer relations for Chrome at Google. Please check it out! Would love to chat more about future opps.

Bramus

Oh nice, @FirefoxNightly now has support for the 'interactive-widget' meta viewport key, to control the viewport resize behaviour when showing a virtual keyboard.

There are 3 values to choose from: resizes-visual, resizes-content, and overlays-content.

You can use one of these values to prevent a `position: fixed` element from getting placed underneath the virtual keyboard.

See developer.chrome.com/blog/view for all details.

Supported in Chrome from Chrome 108. No word from Safari on this.

Oh nice, @FirefoxNightly now has support for the 'interactive-widget' meta viewport key, to control the viewport resize behaviour when showing a virtual keyboard.

There are 3 values to choose from: resizes-visual, resizes-content, and overlays-content.

You can use one of these values to prevent a `position: fixed` element from getting placed underneath the virtual keyboard.

Visual showing how each value behaves.
Show previous comments
wakest ⁂

@bramus @FirefoxNightly hey @cheeaun would this help with the weird empty space above the keyboard?

Jonathan Dallas

@bramus I don’t see a WebKit standards position issue for this. Has one been filed? github.com/WebKit/standards-po

Kilian Valkhof

@bramus @FirefoxNightly

Nice. Would be great if browsers could also emulate those changes in svh/dvh wink wink nudge nudge.

issues.chromium.org/issues/408

Go Up