Email or username:

Password:

Forgot your password?
170 posts total
Bramus

I propose: pw;dr to mean “paywall, didn’t read”

Show previous comments
FSMaxB

@Moss Another one cb;dr meaning "cookie banner, did not read"

For search results, I do actually sometimes click away if there is a cookie banner instead of finding out how to decline the cookies.

Saxnot

@Moss makes sense

it's not really a public-ation when it's not public.

Simon

@Moss

I don't disagree.

In the interim I highly recommend Archive.ph which gets around cookie bullshit and paywall

Bramus

New post: “Captured Custom Properties”.

blog.kizu.dev/captured-custom-

In a few of my latest #CSS experiments and articles, I used one naming pattern for registered custom properties that I think worth highlighting in a separate blog post. This pattern allows us to create a set of generic custom properties, covering a wide set of use cases for computing and storing their values.

Roma Komarov

As usual, credits:

- @5t3ph for her article about @property.
- @kevinpowell for his video about inheritance.
- @bramus for his post about feature detection.
- @Una for a CSSWG issue about named container query length units.
- @JaneOri for her `tan(atan2())` technique which I mention once again.
- @argyleink for Open Props (could this pattern be helpful to it?).

Bramus

Introducing @​bramus/style-observer, a MutationObserver for CSS.

It allows you to attach JavaScript callbacks to changes in computed values of CSS properties.

🔗 bram.us/2024/08/31/introducing

Logo for @bramus/style-observer
Bramus

Version 1.2.0 of @bramus/style-observer got published just now.

Since v1.0.0, two options were added:

- notificationMode: pass all properties or only the changed ones into the callback

- returnFormat: pass only the values or a full object with detailed info into the callback

Here’s an example of the extended return format:

```json
{
"--my-variable":{
"value": "1.0",
"previousValue": "0.0",
"changed": true
}
}
```

github.com/bramus/style-observ

Version 1.2.0 of @bramus/style-observer got published just now.

Since v1.0.0, two options were added:

- notificationMode: pass all properties or only the changed ones into the callback

- returnFormat: pass only the values or a full object with detailed info into the callback

Here’s an example of the extended return format:

Bramus

#1 superfan of the CSS Anchor Positioning API: developer.chrome.com/blog/anch

Used it to implement more accessible heading anchor links on `eleventy-base-blog` using sibling elements without a wrapper element 🏆

You can see it in action here: eleventy-base-blog-git-v9-11ty (Chrome and Edge support this, falls back to a nested link in other browsers)

Bramus

Introducing @​bramus/style-observer, a MutationObserver for CSS.

It allows you to attach JavaScript callbacks to changes in computed values of CSS properties.

🔗 bram.us/2024/08/31/introducing

Logo for @bramus/style-observer
Bramus

Version 1.2.0 of @bramus/style-observer got published just now.

Since v1.0.0, two options were added:

- notificationMode: pass all properties or only the changed ones into the callback

- returnFormat: pass only the values or a full object with detailed info into the callback

Here’s an example of the extended return format:

```json
{
"--my-variable":{
"value": "1.0",
"previousValue": "0.0",
"changed": true
}
}
```

github.com/bramus/style-observ

Version 1.2.0 of @bramus/style-observer got published just now.

Since v1.0.0, two options were added:

- notificationMode: pass all properties or only the changed ones into the callback

- returnFormat: pass only the values or a full object with detailed info into the callback

Here’s an example of the extended return format:

Bramus

My team at Apple is growing. We are looking for another web developer advocate! (And yes, someone who can live in the SF Bay Area).

jobs.apple.com/en-us/details/2

Tom Winzig

@jensimmons Would Apple consider hiring me just to fix the one bug where Safari keeps erasing all of my entire cookie history because I have the Developer toolbar enabled? 😬

Bramus

“Shake mouse pointer to locate” is such a good #macOS feature. I use it almost daily.

“Where is that damn mouse again?!–Oh, it’s right there.”

kolya

@bramus if anyone misses this on windows, powertoys provides it. along with a bunch of equally gimmicky/niche tools, but thankfully all optional. learn.microsoft.com/en-us/wind

Jak2k

@bramus
I find shaking the mouse not very comfortable. I prefer pressing the Ctrl key and being growing rings around the mouse. (How Gnome & Windows offer it.)

Šime Vidas

@bramus Apropos shaking being good, shake Moto G4 to toggle flashlight.

Bramus

I built a thing: A MutationObserver for CSS, powered by CSS Transitions and `transition-behavior: allow-discrete`.

github.com/bramus/style-observ

You can use this to track changes in any CSS Property, including Custom Properties (except in Chrome bc it has an `allow-discrete` bug 😭)

Bramus

Here’s a video of it in action: a callback gets executed when – and only when – any of the tracked CSS properties (`--variable1`, `--variable2`, `display`, or `border-width`) their computed value changes.

(Recorded in Safari because of that damn Chrome bug)

Bramus

The last couple of years I've worked on printing on receipt printers from the web. The result is a large number of libraries available for the browser and the web.

In order to make sense of them and what they do, read Receipt Printers 101:
nielsleenheer.com/articles/202

Paul SomeoneElse

@html5test I got into POS and thermal printers from being the IT person at a grocery coop that had no budget.

I keep meaning to buy the same printer on ebay just because it still feels rare to me.
(when in the store we rarely had a hot spare.)

Something like an IBM / Toshiba 4610 which are weirdly not that expensive on ebay.

Bramus

Good reminder: don't lazy load hero or product images.

cloudfour.com/thinks/stop-lazy

It hurts both your UX and your Largest Contentful Paint (LCP) score.

Chris Coyier

If your LCP is still bad, here's good information on finding out why: whitep4nth3r.com/blog/your-bad

It's one of those few-ish performance things that can easily be more back-end than front-end.

Rich Holman

@chriscoyier that is a great reminder. Sometimes it’s easy to fall down the optimse all the things route. Thanks!

Bramus

Great to see Safari Technology Preview 202 add support for View Transition types.

These makes it easier to work with several view transitions on the same page (read: different animations), without the declarations of the one affecting the other.

youtu.be/eY6C_-aDdTo?si=Rd4wsI

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

scroll snap + scroll driven animation carousel

💡 in the mobile size it looks a lot like the iOS app switcher eh?

try it!?

codepen.io/argyleink/pen/MWMQJ

nerdy.dev/container-query-caro

Morgan Davis

@argyleink

Ironically, doesn’t work on iOS. :-)

Now, for extra credit… how can you detect a click on one of the edges of the cards in the back of the stack and have it scroll-snap to that card in the foreground position?

Bramus

Not sure Tim Berners-Lee’s vision was to have 148 requests transfer 5.3 MB of assets to deliver 15 KB of text

#pollution

Show previous comments
Artemesia

@urlyman

...and disable basic browser navigation with half-assed javascript intercepting the user's clicks, then blame the end user for being backwards when the end user complains about this.

ruurd@mastodon.social

@urlyman @jwildeboer while in the mean time consuming an inordinate amount of resources on your local computer…

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

Bramus

🚧 What is blocking=render and why on earth would you do that?! A look at the new blocking attribute and a few use-cases: csswizardry.com/2024/08/blocki

Nathan Knowler

@csswizardry I think another viable use case is defining *some* custom elements as it helps avoid the flash of the element being undefined. To me that frees up the undefined state from needing to serve the defined state (i.e. more equitable progressive enhancement — the experiences don’t need to be exactly the same). Progressive enhancement can be punished with a bad CLS score, but I think this is a more convenient way to avoid it (with its own cost of course).

Go Up