chriscoyier, to random
@chriscoyier@front-end.social avatar

jQuery plugins depended on jQuery, and when jQuery went out of favor, they ended up in the junkyard.

There is all sorts of componentry built exclusively on React, limiting it to React-based sites. As React goes out of favor, they will end up in the junkyard. (Same with any framework-specific extension.)

But with Web Components... it seems like the story will end differently. If they are built without dependencies, they might just live as long as the web does.

westbrook,
@westbrook@mastodon.social avatar

@chriscoyier That's not wholly true. jQuery plugins and React components fail over time because they belong to their dependencies, not the other way around.

A properly encapsulated can have just any dependencies it wants as long as they don't leak. In fact, the internal dependencies could be jQuery or React as long as the consuming app doesn't need to know about it.

There are performance realities there, but that's true today as much as it would on the last day of the web.

tixie, to webdev
@tixie@guerilla.studio avatar

Hmm I'm wondering if declarative Shadow DOM in Web Components would open the path to new patterns of making nicer without-JS-fallback than with <noscript> elements

But some experiment gonna be… as always… for some other days

#WebComponent #ShadowDOM #WebDev

pablolarah, to webdev
@pablolarah@mastodon.social avatar

🟢 The different ways to instantiate a Web Component
by Chris Ferdinandi @ChrisFerdinandi @cferdinandi

https://gomakethings.com/the-different-ways-to-instantiate-a-web-component/

tomhazledine, to random
@tomhazledine@mastodon.social avatar

What's this? Another last-thing-on-a-friday release of a thing? It’s like I'm a marketing genius or something…

Anyway, my "stacked sparklines" is now available for folks to download and play with.

(fancy page demoing all the options coming “soon”)

https://github.com/tomhazledine/stacked-sparklines

cory, (edited ) to javascript
@cory@social.lol avatar

Alrighty, select-pagination https://www.npmjs.com/package/@cdransf/select-pagination

It assumes you’re using a simple numeric pagination of the type /1 /2 etc.

cory,
@cory@social.lol avatar
cory, to javascript
@cory@social.lol avatar
mez, to webdev
@mez@mastodon.nz avatar

While we’re all trying to figure out best practices for web components, I think we need to also be discussing when they are the best solution for the situation.

I’ve been trying to use them to add a search input for a table of data, and based on styling and how the Shadow DOM works, I’m just not convinced this is actually a good use case. It has fragility hidden by the structure of web component technologies.

jgarber, to accessibility
@jgarber@mastodon.cc avatar

New to add to your collection: <aria-collapsible>

Generate progressively-enhanced collapsible regions using States and Properties.

💻 Code: https://github.com/jgarber623/aria-collapsible

🧩 Demo: https://jgarber623.github.io/aria-collapsible/example/

📦 Package: https://www.npmjs.com/package/@jgarber/aria-collapsible

khalidabuhakmeh, to random
@khalidabuhakmeh@mastodon.social avatar

The latest EAP of (2024.1) has a new “create a new file from snippet" button in the Assistant chat. Select the folder in which you want to drop the file, then click the button.

Here, I created some boilerplate for a new .

DavidDarnes, to random
@DavidDarnes@mastodon.design avatar

Not only does Apple have documentation on how to style <button> elements to be an Apply Pay button (Safari cheekily comes with appearance: -apple-pay-button built in), but they also have their own to achieve the same effect. It even uses CSS Custom Properties to style it:

https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_css

https://developer.apple.com/documentation/apple_pay_on_the_web/displaying_apple_pay_buttons_using_javascript

ctietze, to CSS
@ctietze@mastodon.social avatar

Build an off-canvas menu with <dialog> and web components - LogRocket Blog https://blog.logrocket.com/build-off-canvas-menu-web-components/

Technically, I think this is an interesting approach.

But having an actual navigation menu in a <dialog> instead of the main DOM also sounds like a bad idea -- how is accessibility of the navigational elements?

inautilo, to animation
@inautilo@mastodon.social avatar

#Development #Techniques
Off-canvas menu with ‘dialog’ and web components · “The HTML ‘dialog’ element is not just for creating modals.” https://ilo.im/15xtfg


#Navigation #Modal #Animation #Accessibility #WebDev #Frontend #WebComponent #HTML #CSS #JavaScript

cirrus, to Figma
@cirrus@mstdn.social avatar

Once again facing that classic conundrum: Theme and/or customize a 3rd party component library, or build one from scratch.

Actually, we need two component libs: A one for web products and a one for iOS & Android apps. We already have designs in and want to have parity in terms of design & naming across Figma, web & RN.

My gut and past experiences make me lean towards building from scratch.

What would you do and why?

scrwd, to random
@scrwd@mastodon.social avatar

I'm working on an accessible menu-button following that pattern https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/

I'm looking for suggestions how to attach actions to the menu items themselves. The markup below is upgraded with appropriate roles and behaviours. But in a generic component, what is the best strategy for supporting custom actions?

&lt;menu-button&gt;  
 &lt;button&gt;Toggle&lt;/button&gt;  
 &lt;div&gt;  
 &lt;button&gt;Action 1&lt;/button&gt;  
 &lt;button&gt;Action 2&lt;/button&gt;  
 &lt;/div&gt;  
&lt;/menu-button&gt;  

inautilo, to webdev
@inautilo@mastodon.social avatar


HTML web components on the server are great · Server-side HTML web components are easier to scale https://ilo.im/15xtg5


chriskirknielsen, to random

Free HTML Web-Component: <animated-details>. Like a regular <details> element, but, like, animated! It uses that 0fr/1fr trick to animate the height, the only reason it's a web component is that I'd sometimes only get the transition once, or not at all? So JavaScript, of course. Progressively enhanced, of course. Respects user's motion preferences, of course.

↕️ https://codepen.io/chriskirknielsen/pen/yLwoxdr?

davatron5000, to random
@davatron5000@mastodon.social avatar

🚀 Introducing WobblyBox, a for wobbly boxes.

Write-up: https://daverupert.com/2024/01/wobblybox/
GitHub: https://github.com/davatron5000/wobbly-box

khalidabuhakmeh, to webdev
@khalidabuhakmeh@mastodon.social avatar

Hey folks. Is there an event you can subscribe to as to when ANY custom elements get registered with the page?

Note: I am aware of customElements.whenDefined('my-custom-element’).

khalidabuhakmeh, to random
@khalidabuhakmeh@mastodon.social avatar

JSX is a hill-billy family reunion where all the cousins are fucking. They all look the same, but they are all slightly broken in subtle ways.

khalidabuhakmeh,
@khalidabuhakmeh@mastodon.social avatar

@eldamir tbh, JavaScript isn't the issue. If you follow the hashtag, you'll see how far the web platform has come and how build tools may soon be unnecessary.

davatron5000, to random
@davatron5000@mastodon.social avatar

New version of Reddit looks like it's rolling out.

colinaut, to random
@colinaut@dice.camp avatar

Updated my action-table to 2.0 with a number of new features that I wanted including:

  • local storage for saving sort/filter state
  • URL search params for setting initial sort/filter
  • free text search input filter
  • whole table search
  • more little touches

https://colinaut.github.io/action-table/

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

noleli, to random
@noleli@mastodon.social avatar

Firefox’s :has() implementation lets you do :host(:has(:checked))!

That means you can very easily wrap a radio button with a to totally customize it!

Firefox 121 (or dev/beta/nightly) only: https://codepen.io/noleli/pen/yLZGqox

Doesn’t work in other :has-having browsers :(

Option A Option B

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

More on my with kick. Here is the same counter component counting by passing values to the server and back.

Vanilla WebComponent with fetch calls to ASP.NET Core backend

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