-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
5798739
to
7ac1f42
Compare
There are a lot of subtlties involved in the colors and behavior of the button. This allows us to pass a few configuration options in, including a `color` prop, and all these color properties will be handled automatically.
7ac1f42
to
14f0b18
Compare
color: | ||
feel === "flat" && theme === "dark" | ||
? colors.grey.dark | ||
: colors.grey.light, | ||
}, | ||
}, | ||
}, | ||
|
||
{ | ||
backgroundColor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This object and the one above it in the array could be merged together:
[
{'&[disabled]': ...},
{backgroundColor: ...},
// ...other stuff
]
// can be...
[
{
'&[disabled]': ...,
backgroundColor: ....,
// ...other keys
},
// ...other objects
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cheapsteak explicitly separated them out, but I don't remember why. I think I'll leave it for now. This whole thing could use a clean-up, but it should be ready to ship now.
Ship when it's useful, not perfect!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the file from when I converted the original single object into arrays of objects
https://github.com/apollographql/space-kit/blob/f2ed4b77f16d6412a9ec0dc0ce5d01abdea45dd2/src/Button.tsx
At the time there was a conditional variant === "simple" && { backgroundColor: "transparent" },
separating the 1st block and the 3rd block.
Lines 105 to 108 in f2ed4b7
}, | |
variant === "simple" && { backgroundColor: "transparent" }, | |
{ |
It looks like that's been removed so these two should be good to merge into one object (non blocking of course)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cheapsteak ! Always good to get context from the source. Since this hasn't been approved by anyone I'll make the change.
non blocking of course
Very much appreciate when people write this.
Looks good @justinanastos! Just a few small comments above 👍 |
I still am unable to override the text color of these buttons unless I wrap the text in its own text color, why is the default black for a red button? To fix, could we add a classNames prop? |
You can't override with tailwind yet because of emotion. There's a way to get past that but I haven't figured it out out. We don't need to add a |
@justinanastos -- Here's what I'm seeing needs to change:
|
6af8cdd
to
3e74d40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna do some head-down coding (don't block on me)
Will leave this review to the other capable eyes here
@adamatorres great eyes. the icons and text alignment were also off in the simple buttons. Should all be correct now! |
There are a lot of subtlties involved in the colors and behavior of the
button. This allows us to pass a few configuration options in, including a
color
prop, and all these color properties will be handled automatically.