LiveDuo / destack

Page builder for Next.js 🅧. Zero-config deployment 🚀. React now supported!
MIT License
1.56k stars 314 forks source link

Picking colors #74

Closed augustofretes closed 1 year ago

augustofretes commented 1 year ago

Hi! I'm trying to add a color picker to destack. I made a couple of changes to text.tsx on a fork, I essentially added colors to props, and then I thought of creating an analogous to ButtionDialog.tsx, TextColorPickerDialog.tsx . Do you think this is the right approach? The reason I ask is because I know destack is pulling colors from the themes directly, e.g. bg-indigo-600.

LiveDuo commented 1 year ago

@augustofretes I think using the props is fine in general.

There are two approaches: a) Override the CSS styles b) Override the CSS classes

I think the first approach ie. the one you chosen is cleaner, more flexible because you can choose any colour or add custom logic to the colour picker. Only advantage to 2nd method I see is better coherency by restricting user to only choose selected classes/colours.