News for hackers. Stuff that matters.
Re:Lit: Simple. Fast. Web Components by samwillis on Thursday July 20, 2023 @05:26PM (#36806974)
Lit looks really good, I keep trying to find an opportunity to try it out. I feel like web components and the tooling around them has finally got there. Major front end frameworks like React, Vue and Svelt finally also have good support for them.

What I really want is a good set of unstyled web components implementing many of the common UI controls that we all end up either building ourselves or finding an implementation of in our framework of choice. Things like drop down menus, select boxes, and tool bars. They could then be used with any of the common front end toolkits.

Re:Lit: Simple. Fast. Web Components by psygn89 on Thursday July 20, 2023 @05:34PM (#36807062)
Agreed. I get excited to see "headless components" until I read the fine print that it's locked into framework x (usually React). I wish there was a robust headless AND framework-agnostic component library (preferably relying on Lit or Stencil).
Re:Lit: Simple. Fast. Web Components by samwillis on Thursday July 20, 2023 @05:40PM (#36807119)
Think thing is that Ionic have proven this can work with the massively underrated Ionic Framework (built with Stencil, which they also built). I just wish they expanded a little further into desktop UI components and provided an no/low styled variant - I dislike Material as a base style, it's too opinionated.
Re:Lit: Simple. Fast. Web Components by commanderkeen08 on Thursday July 20, 2023 @05:44PM (#36807159)
Nobody wants Shadow DOM though. Using ::part is always clunky and we’re all lying to ourselves when we say “oh no that’s the feature”.

The whole shadcn/tailwind philosophy of having you own your components is the future.

Re:Lit: Simple. Fast. Web Components by johne20 on Thursday July 20, 2023 @06:32PM (#36807653)
You don't need to use Shadow DOM though?
Re:Lit: Simple. Fast. Web Components by jakelazaroff on Thursday July 20, 2023 @05:55PM (#36807265)
Wait, but that is the feature. My issue with Shadow DOM is that "base" styles (like fonts and colors applied to tag selectors) don't come through, not that I can't override any given style from outside.

I'm not really sure what you mean by "own your own components"?

Re:Lit: Simple. Fast. Web Components by sublinear on Thursday July 20, 2023 @05:47PM (#36807191)
At my workplace we only ever used it once to build a skinnable white label customer support widget for about a dozen of our client's websites.

It's a webcomponent that gracefully degrades to es5 + polyfills for IE (this was years ago).

Getting the rollup build to work correctly was a bitch and a half, but it turned out nice and it's still in use today.

Re:Lit: Simple. Fast. Web Components by e111077 on Thursday July 20, 2023 @06:55PM (#36807882)
unstyled web components: look into ING Lion Web Components (Lit-based) or @generic-components/components (vanilla)
Re:Lit: Simple. Fast. Web Components by claviska on Thursday July 20, 2023 @09:42PM (#36809093)
Creator of Shoelace [0] here. As someone who’s built multiple design systems and component libraries, I assure you that unstyled (or “headless”) components are often much more time consuming and painful to adopt than those with good default styles.

That said, I commonly find that most folks don’t want unstyled components because it’s quite a bit of work to style every single state of every single component. Most people just won’t do it or, if they try, they don’t do it right and they don’t do it completely.

What many folks do want are components that have simple, generic styles you can quickly tweak to match your site/app using a skill you already know: CSS. (This is something you can do with Shoelace’s 50+ web components already, but we’re working to make it even easier with additional CSS custom properties.)

[0] https://shoelace.style/

Re:Lit: Simple. Fast. Web Components by dleeftink on Thursday July 20, 2023 @11:54PM (#36809811)
Thanks so much for your work, the components look great and straightforward to use. Next time I'm building something will definitely try to give Shoelace a spin.

Can I ask, are ARIA attributes handled by default?

Re:Lit: Simple. Fast. Web Components by brylie on Friday July 21, 2023 @02:56AM (#36810791)
Perhaps this isn't as specific of an answer as you're looking for, as I'm not too familiar with the Shoelace library, but perhaps we gain some insight from the Shoelace Accessibility Commitment.

> My commitment to Shoelace users is this: Everything I develop will be built with accessibility in mind. I will test and improve every component to the best of my ability and knowledge. I will work around upstream issues, such as browser bugs and limitations, to the best of my ability and within reason.

https://shoelace.style/resources/accessibility/index.html

Re:Lit: Simple. Fast. Web Components by claviska on Friday July 21, 2023 @08:18AM (#36812940)
The goal is to handle as much accessibility as possible with smart defaults and by making it easy for users to get right. Currently, all aria stuff is handled internally the components. For example, look at <sl-input> and you’ll see that the input, label, and help text are automatically linked in the shadow root. The minimum the user needs to provide is a label and assistive devices work as expected.
Re:Lit: Simple. Fast. Web Components by maxwin on Friday July 21, 2023 @03:19AM (#36810948)
It is very true. Most of us who are not designers just want a very good looking default style. We can change if we want to later. It is a pain that react doesn't come with default style.
Re:Lit: Simple. Fast. Web Components by rahoulb on Friday July 21, 2023 @05:11AM (#36811687)
Just want to say I'm using Shoelace in two Rails projects and I absolutely love it.

Thank you very much.

Re:Lit: Simple. Fast. Web Components by maxkless on Friday July 21, 2023 @02:53AM (#36810774)
check out @microsoft/fast-foundation. It’s UI primitive web components and works really well with lit.
Re:Lit: Simple. Fast. Web Components by dgb23 on Friday July 21, 2023 @06:43AM (#36812232)
I haven't used Lit yet, but have used lit-html standalone professionally for some projects. (lit-html is a very small, very performant library and the templating solution for Lit).

I'm very happy with it. I don't have a use-case for web components (so far) and am happy to just wire up dom events to state changes to lit-html. It requires _very_ minimal plumbing and is very easy to reason about.