3 ms·
Like bootstrap it's a set of standard behaviours and styles. Bootstrap basically takes standard elements and when you add CSS classes and data properties, it s
by rahoulb 3y ago
Like bootstrap it's a set of standard behaviours and styles.
Bootstrap basically takes standard elements and when you add CSS classes and data properties, it styles them and adds some JS behaviours.
Shoelace builds HTML custom elements, using CSS variables for controlling the style, with the JS baked into the custom-element code. And Shoelace uses the shadow DOM, so any customisations do not "leak" outside of your components (although this has its own implications).
Custom elements basically do the same as React/Vue/whatever (reactive properties, slots etc) but in a manner that's built into the HTML spec and into all browsers. (React/Vue et al also have mechanisms for building your components as custom-elements, but you're then adding the dependency on React/Vue when you reuse them - although Shoelace has a dependency on lit.dev, as the actual custom-elements spec is quite low-level).
But Bootstrap and Shoelace are essentially solving the same problem - a reusable design system - but Shoelace does it in a way that's already built in to browsers and arguably cleaner to use.