Advertisement · 728 × 90

Posts by Jacob Berglund

Sorry if I’m late to the party, but it occurred to me that cascade layers can be used to show the most important CSS at the top.

Like a button with variants. I want the variants up top and not the base. Without cascade layers this requires smartness™.

Nice.

1 month ago 0 0 0 0

It makes some assumptions: It posts on blur with a custom header (X-Enhance-Validate). You gotta for that header that, do the validation and not doTheThings(). Make sure you return the same form with a 422 status code. And that's pretty much it. Hey-o!

1 month ago 2 0 0 0
Preview
GitHub - jberglund/enhance-form: A web component to progressively enhance HTML forms A web component to progressively enhance HTML forms - jberglund/enhance-form

Made a web component to progressively enhance good ol' SSR forms. Introducing <enhance-form>! You wrap a form with it and you'll get inline form validation with minimal effort.

Heavily inspired by Unpoly 😍

1 month ago 2 1 1 0

Just reading the description and I'm like "omg yes plez and thank you!". I'm deep in progressive enhancement territory at this point and I do not want to go full shadow DOM. Something like this would slot right in, assuming my interpretation of the description is correct 😅

1 month ago 1 0 0 0
Preview
sugarcube Design tokens, generated CSS, and optional components. Build front ends on strong, reusable foundations.

Sugarcube is now publicly available!

sugarcube.sh

1 month ago 52 14 4 1

Laughed out loud on the bus thanks to this! Much appreciated 😂

1 month ago 1 0 0 0

I’m done with Spotify. It just doesn’t feel like the app I used to love.

1 month ago 0 0 0 0
Video

i built an entire x86 CPU emulator in CSS (no javascript)

you can write programs in C, compile them to x86 machine code with GCC, and run them inside CSS

lyra.horse/x86css/

1 month ago 2616 871 132 159
Advertisement

130 files changed, 125 insertions(+), 8115 deletions(-)

Today was a gooood day. 🪓

Shoutout to knip.dev!

1 month ago 0 0 0 0
Video

Just shipped bsky-comments!

Embed Bluesky threads anywhere with a zero-dependency Web Component.

• Framework Agnostic (Native WC)
• < 3kb gzipped
• Zero Config: Just paste the Post URL
• Light DOM: Fully customizable (CSS/Tailwind)

github.com/florianschep...

#webdev #opensource #buildinpublic

1 month ago 181 34 2 3
Preview
GitHub - bramus/style-observer: MutationObserver for CSS. Get notified when the computed value of a CSS property changes. MutationObserver for CSS. Get notified when the computed value of a CSS property changes. - bramus/style-observer

If you just want a variable from CSS to JS, have a look at github.com/bramus/style...

But I suppose the component I made could emit an event with the name, value and unit. 😁

1 month ago 1 0 1 0

Like, you update a variable and the input changes?

1 month ago 0 0 1 0
Video

Made a customizable-face-looking-at-the-cursor thing.

Try it out: varianter.github.io/fjes/

Feedback is welcomed 😊

1 month ago 2 0 0 0

Ha! It never struck me that an input without a name doesn’t get serialized in a form. Makes sense now though 😂

Imma yoink that.

I feel like this is WKs fault for not allowing us to extend elements. Kind of have to implement the basics all over.

2 months ago 0 0 0 0

Hat off though. It is humbling to get a glimpse of how much effort goes into these things. 🙏

2 months ago 1 0 0 0

Oh my, this is nicely documented. The remark answered my question 😅

github.com/microsoft/fl...

2 months ago 1 0 1 0
Advertisement

Oh, that is interesting. Does it stay out of forms when slotted?

2 months ago 0 0 1 0

Probably works crappy on mobile devices.

It is an attempt at making a pattern which isn’t necessarily a combobox, but could be used as such. The pattern being the point.

If you have any feedback or point me to where I could read up on the things you mentioned, I’d really appreciate it 🙏

2 months ago 1 0 1 0
Preview
Progressively enhanced combobox ...

Yarr! I was thinking about this the other day and experimented a bit using the text input inside shadow dom and requiring ARIAs in the light DOM for correctness.

codepen.io/jacobberglun...

2 months ago 1 0 1 0

The excitement is knowing there is an non-zero chance of death or other injuries.

And upon reading the obituary: ”yep, that’ll do it”

2 months ago 1 0 0 0
Preview
Progressively enhanced combobox ...

Woo! 🕺 I was just thinking of this and how to solve it using just popovers+checkbox/radios, but a native way? Sign me up!

Just built this to do ish that codepen.io/jacobberglun...

I'll update Chrome and have a look to see how keyboard nav is handled. 🥳

2 months ago 1 0 0 0

What is a combobox if not a popover, a text input to filter checkboxes/radios? Move the input, add in some arrow navigation and a programmatic click() and you got yourself a A+ LightDOM web component.

The progressive enhancement is that it’s just a popover with some radios/checkboxes.

2 months ago 2 0 1 0

Ah, thanks, didn’t know. 💡

Where do the rejected proposals go? Do they keep returning year after year, per community initiative?

2 months ago 0 0 1 0

For most, the LightDOM way should be enough, right? Like, we can still compose HTML on a server and call it a button.

I’ve gone as far as to put an inert <swap-to-spinner> wc inside a <button>. Mainly because making a <custom-button> seems… well, non-trivial.

2 months ago 0 0 1 0

Secret vetoes? 🥸

2 months ago 0 0 1 0
Advertisement
Building Websites With LLMS Writing about the big beautiful mess that is making things for the world wide web.

gushing over the maintainability and simplicity of @jim-nielsen.com’s menu as a whole dang separate-standalone-HTML-page: blog.jim-nielsen.com/2025/lots-of...

(via @dbushell.com)

2 months ago 34 10 7 3

Oooh, nice. I’d even italicize that nice were it possible. That nice.

I’m all for this simplicity. Like, a form with a method=get and some view transitions goes a long way as well. Basically free niceness.

2 months ago 1 0 0 0
Preview
Wes Cook and the Centralia McDonald's Mural A personal story about discovering a mural in a McDonald's, an unknown artist named Wes Cook, saving the mural, and a conference talk about the whole thing.

over a year ago, i gave a talk at the xoxo conference about a mural, a mcdonald’s, and a man. (but it was also secretly about life, and legacy, and meaning.)

finally, i’m blogging the full story, with behind-the-scenes details, and a video of the talk.

enjoy. cabel.com/wes-cook-and...

2 months ago 384 107 28 28
css-var-bind - Interactive Demo

Zoom, zoom! Made a demo/docs site for my utility web component css-var-bind. If you've got any suggestions for neat demos/examples, do know that they are appreciated.

jberglund.github.io/css-var-bind/

Repo here: github.com/jberglund/cs...

2 months ago 2 0 1 0
Preview
GitHub - jberglund/css-var-bind: A utility web component which binds (and syncs) inputs to CSS variables A utility web component which binds (and syncs) inputs to CSS variables - jberglund/css-var-bind

I made a thing! This has been my workhorse for experimenting and creating token systems in CSS.

Works really well with different input types; number, range, color.

github.com/jberglund/cs...

2 months ago 3 0 0 0