DEV Community

Discussion on: Let's Build a Colour Picker Web Component

Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦 • Edited

Good point! if the native widget fulfills your needs, it would be irresponsible to use JavaScript of any flavour to deliver the feature.

There could be lots of reasons to want a custom element for this, though. Off the top of my head I can think of two:

  1. design system integration
  2. colour controls that native doesn't provide (like colour spaces)

To answer the question "Why write a blog post about making a colour picker?" - The specific content here isn't as important as the concepts of

  • How Reactive Controllers work with Custom Elements
  • That you can use Controllers without using LitElement, via the mixin
Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

@codingsafari do you have another idea for how to use a MouseController? I'd love to see how you remix the glitch