quarkly / atomize

library for creating atomic react components
https://atomize.quarkly.io
MIT License
66 stars 6 forks source link

Question: Why is effects seperate? #27

Closed gregg-cbs closed 3 years ago

gregg-cbs commented 3 years ago

Hello,

I am reading about Atomize trying to figure out if I should adopt it for this large project I am starting.

Im curious why you didn't bake effects into the system and why you decided to make developers manually enable effects? It feels strange to do this:

const Button = atomize.button({
    effects: {
        hover: ":hover",
        focus: ":focus",
        active: ":active",
        disabled: ":disabled"
    }
});

Thanks

eddort commented 3 years ago

Hello! Setting effects manually allows you to write your own selectors. There are no default effects at the moment, would you like us to add them?

gregg-cbs commented 3 years ago

Hello Alexander :)

Effects like 'hover' are native to css.

Do I have to add this hover effect:

const Button = atomize.button({
    effects: {
        hover: ":hover",
    }
});

In order to use hover?

<Button 
    hover-bgc="yellow"
/>
eddort commented 3 years ago

Yes, in the current version you should add this effect. In the future, we'll add effects (such as hover, focus, etc.) as default effects, and you will be able to use a component without the effects option.

gregg-cbs commented 3 years ago

Nice thanks.

Im going to close this.