question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Button] `variantColor` does not work with `COLOR_NAME.600`

See original GitHub issue

I want to set Button’s variantColor to blue.600 (from the default theme):

<Button m={2} variantColor="blue.600" variant="solid">
	LinkedIn
</Button>

Unfortunately, it doesn’t fully render the button (no text, color, shape; only on hover text underline is visible). When I use variantColor="blue" it works correctly:

It also doesn’t work with other colors, ex. red.300.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lee-reinhardtcommented, Nov 18, 2019

@xxczaki If you read Segun’s answer, he explains why you can’t pass a plain color, or even theme-config color like blue.600 to the variantColor prop. The button component has behavior that relies on using more than one value from the theme variant color specified source.

The reason is that Button has interactive styles (hover, action, disabled) and we pick color values from the object to make it work out of the box.

You can work around this by making your own entry in the theme colors that satisfies all the numbers, or override styles via _active, _hover, etc. props.

0reactions
sethburtonhallcommented, Jan 5, 2021

I thought it would be helpful to share this code sandbox for anyone with the same issue.

Thanks @dodas !!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chakra UI colorScheme prop on button - Stack Overflow
The colorScheme just accepts the color name. In your case, it will be colorScheme="brand" . If we inspect the way chakra works to...
Read more >
Color Variants | Reference - BootstrapVue
Color variants and CSS class mapping. Below are the variants available when using the default Bootstrap v4 CSS. When using BootstrapVue components, ...
Read more >
React Colors with Bootstrap - examples & tutorial
Colors built with Bootstrap 5, React 17 and Material Design 2.0. Enables comprehensive color customization of theme, background, text, links, buttons and ...
Read more >
Customize Theme - Chakra UI
You're not limited to the component styles that Chakra provides, you can ... For example, let's override the component styles for Chakra's Button...
Read more >
Buttons · Bootstrap v5.2
If you don't want the button text to wrap, you can add the .text-nowrap class to the button. In Sass, you can set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found