VincentTunru, to webdev
@VincentTunru@fosstodon.org avatar

Question for the @frontend community:

What benefits would you say Web Components have over a framework's components, besides not being tied to a framework?

Jbasoo, to 11ty
@Jbasoo@mastodon.social avatar

I've just started learning #webComponents and oh my days there seems to be a lot of ways to boilerplate this. Should I just use #Lit? It looks like I'd need a bundler which seems overkill for my tiny #11ty site.

Also, are there any good courses around?

brianleroux, to webdev

🌶️🥵 shadowdom is awesome but has many tradeoffs that put it in YAGNI territory and should only be a last resort not a default

(lightdom works great ! it got us here)

smallcircles, to webassembly
@smallcircles@social.coop avatar
DavidDarnes, to random
@DavidDarnes@mastodon.design avatar

Sharing another Web Component today. This is the one that kinda sparked things off for me to create small, but useful, that I would benefit from and maybe others too.

I wanted to utilise the :playing pseudo selector to style elements when an audio element is playing, but it's only available in Safari. So I made a Web Component:
https://darn.es/is-playing-web-component/

davatron5000, to random
@davatron5000@mastodon.social avatar

📝 New post: If are so good, why am I not using them?

https://daverupert.com/2023/07/why-not-webcomponents/

rauschma, to random
@rauschma@fosstodon.org avatar

: My knowledge of them is limited, but the cross-platform story looks relatively good now: https://caniuse.com/?search=web%20components

One important piece is declarative shadow DOM. It enables better server-side rendering and UIs that work without JavaScript. It’s now supported by Chrome and Safari, but not by Firefox.

What is still missing? I remember reading that accessibility was an issue in some cases. Is that still true?

ayo, to webdev
@ayo@ayco.io avatar

🎉 Here it is! https://WebComponent.io

A zero-dependency, ~600 Bytes (minified & gzipped), JS base class for creating reactive custom elements easily.

ayo, (edited ) to webdev
@ayo@ayco.io avatar

Using lit-html with https://WebComponent.io 🤣

An example of using custom templating syntax & renderer 🎉

Try it on CodePen: https://codepen.io/ayoayco-the-styleful/pen/ZEwNJBR?editors=1010

DavidDarnes, to random
@DavidDarnes@mastodon.design avatar

Newly added to my collection: <link-peek>!

Turn any regular anchor link into a rich preview (also known as an ‘unfurled’ link). Can be used with any JSON API and allows for custom templating.

Prefect for creating more visual interest on links without filling the page with additional HTML noise:

✍🏻 https://darn.es/link-peek-web-component/
📦 https://www.npmjs.com/package/@daviddarnes/link-peek

ayo, (edited ) to random
@ayo@ayco.io avatar

Wrote a minimal base class for creating my custom elements easily, so I only have to define the template and observed attributes. :)

https://git.sr.ht/~ayoayco/web-component-base

westbrook, to webdev
@westbrook@mastodon.social avatar

What follows are some theoretical user stories for external styling of custom elements (usually with shadow DOM).

Favorite/boost the ones you think are important.

Add some you might think are missed.

Argue some that you think don't capture the nuance of the situation.

Happy Friday!

DavidDarnes, (edited ) to random
@DavidDarnes@mastodon.design avatar

This is a pretty uninformed response to @jakelazaroff's article on longevity from Kent Dodds:
https://kentcdodds.com/calls/04/25/jake-lazaroff-s-article-on-web-components

  • Compares React to WC, not knowing you can and should use them together
  • Looks to popularity as benchmark, which leads me to believe that they’re using Twitter as a datapoint 🫠
  • Refers to a 3+ year old article
  • Jumps to AI (???) as if WC needs to match it

Here's Jake's original article:
https://jakelazaroff.com/words/web-components-will-outlive-your-javascript-framework/

mez, to webdev
@mez@mastodon.nz avatar

How would you handle doing a (progressive enhancement) web component that needs to handle a click event, but the underlying element it wraps also needs to handle that click event to do something different in the event that the user agent doesn’t support custom elements?

So, a button with an event handler wrapped in a custom element that progressively enhances the click event to do better stuff if supported.

westbrook, to webdev
@westbrook@mastodon.social avatar

I just shared my thoughts on @bkardell's Half Light library. Have you!?

https://github.com/bkardell/half-light/issues/1#issuecomment-1935083260

Join the conversation around opening the style API for Shadow DOM-bearing elements.

cory, to javascript
@cory@social.lol avatar
colinaut, to random
@colinaut@dice.camp avatar

Been digging this idea of simple practical native HTML because sometimes you just need to drop in a little functionality. I built a component for easily sorting and filtering tables. https://colinaut.github.io/action-table/

jrjurman, to webdev
@jrjurman@fosstodon.org avatar

Very excited about what will be the v4 release of Tram-Lite - an HTML-first way to build or enhance web-components!

https://github.com/Tram-One/tram-lite/pull/30

There's still some administrivia, docs and so on, but if anyone is interested, there's a beta release that people can try out right now!

https://unpkg.com/tram-lite@beta

Happy to take any questions and feedback here on Mastodon!

#WebComponents #HTML #htmlFirst #TramLite

horuskol, to accessibility
@horuskol@phpc.social avatar

It's , but I want to put a little twist on it:

Do you have a blog with an feed?
Do you write about ?

Because I'd like to follow you and your feed :)

ayo, (edited ) to random
@ayo@ayco.io avatar

🎉 New major release v2.0.0!

New Features

  • Easily define and initialize props that get translated into observed HTML attributes
  • A new minimal html function for tagged templates powered by preact's tiny (450 Bytes) htm/mini
  • Attach "side effects" that gets triggered on property value changes with attachEffect
  • All internals now exposed as utils in web-component-base/utils

https://github.com/ayoayco/web-component-base/releases/tag/v2.0.0

DavidDarnes, to random
@DavidDarnes@mastodon.design avatar

What directories should I be submitting my components to? 😊

DavidDarnes, to mastodon
@DavidDarnes@mastodon.design avatar

New addition to my #WebComponents collection: <mastodon-post>!

Embed mastodon posts on your web pages by progressively enhancing a regular link and without the need for an <iframe>. Use the built in semantic template or apply your own! Read more about it here:
https://darn.es/mastodon-post-web-component/

#InideWeb #Webmentions #Mastodon

Thanks to @robb and @mariohamann for the inspiration ✨

bp, to random

After almost a year of discussions, Apple confirms what we already knew: there will be no customized built-ins

https://github.com/WebKit/standards-positions/issues/97#issuecomment-1645167814

nolan, to random
@nolan@toot.cafe avatar

New blog post: "Web component gotcha: constructor vs connectedCallback" https://nolanlawson.com/2024/01/13/web-component-gotcha-constructor-vs-connectedcallback/

This is just a quick post on a anti-pattern that I've seen countless times.

mia, to CSS
@mia@front-end.social avatar

Sometimes I build a custom element, and then I have second thoughts about it.

Do I really need:
<color-tile>teal</color-tile>

When CSS allows:
<code style="--tile:hotpink">hotpink</code>

I wish I could have the cleaner markup, without the JS dependency. Or split the difference, if we had the full attr() function:

<code color-tile="hotpink">hotpink</code>

What do you think?

https://www.miriamsuzanne.com/2024/01/24/el-2-ways/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines