rtivital / omatsuri

PWA with 12 open source frontend focused tools
https://omatsuri.app
MIT License
2.54k stars 201 forks source link

Replace react-color with react-colorful #5

Closed omgovich closed 3 years ago

omgovich commented 3 years ago

Hi @rtivital! Love this project, but noticed that you're using react-color which doesn't support tree-shaking, costs you more than 140 KB, and works quite slow. Also, I saw your attempts to customize their inlined styles (it hurts).

I had the same problems several months ago and that's why I and few other guys have developed react-colorful. It's a modern, fas and lightweight alternative to react-color.

react-colorful is...

  1. 20+ times lighter than react-color
  2. Works waaay faster
  3. Tree-shakeable
  4. Has no dependencies
  5. Well-tested and written in strict TS

And it fits better for your purposes because:

  1. Has stand-alone HexColorInput component
  2. Customizable (forget about & > div > div:nth-child(2) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1))

I kept the default react-colorful's picker styles, but if you want to change it somehow, let me know:

image

Hope it helps)

rtivital commented 3 years ago

Привет! Looks good, please, add yourself to contributors section and I'll merge it then – https://github.com/rtivital/omatsuri/blob/master/src/data/settings.js#L14

omgovich commented 3 years ago

@rtivital Done)

rtivital commented 3 years ago

Thanks