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.

[Box] Property 'outline' should accept theme colors

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

Using eg. outline="red.500" it’s left as-is instead of transforming it to correct color.

Expected Behavior A clear and concise description of what you expected to happen.

Color should be transformed.

@chakra-ui/core: 0.8.0

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
segunadebayocommented, Aug 10, 2020

Hi @FredyC,

I agree with @with-heart. outline is a shorthand property for outline-width, outline-color, and outline-style. It depends on what you want to achieve.

  • If you really need to set the outline color, I’d recommend you pass outline: 2px solid, and then outlineColor: red.500,
  • If you wanted to change the outline around most Chakra components, I’d recommend you do so from theme.shadows.outline
  • Finally, you can also try borderColor

As regards accessibility, the goal of an outline is to indicate where the user’s focus is at any point in time. You can achieve that with any of the 3 options above.

Hope this helps.

Cheers.

0reactions
danielkczcommented, Aug 12, 2020

Well, so outlineColor and others are part of the upcoming 1.x only as it seems. I don’t feel like upgrading just because of that and deal with other changes.

The theme.shadows.outline would be lovely as a unified way, but it only sets box-shadow property, not the outline.

And the border is not that great option either because sometimes I used it for a different thing.

I will cope somehow, just stating how it is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

outline - CSS: Cascading Style Sheets - MDN Web Docs
There are a few properties that affect an outline's appearance. It is possible to change the style, color, and width using the outline...
Read more >
Change the colors in a text box or shape - Microsoft Support
On the Drawing Tools Format tab, click Shape Outline and, under Theme Colors, pick the color you want. Shape Styles commands on the...
Read more >
Style Props - Chakra UI
The following table shows a list of every style prop and the properties within ... `theme.colors.gray[50]` ... <Box border='1px' borderColor='gray.200'>.
Read more >
Theme Configuration - Tailwind CSS
The theme object contains keys for screens , colors , and spacing , as well ... Out of the box, your project will...
Read more >
Global Theme Properties - Grommet
An object can be passed with a color and opacity or with a dark and light value. color can accept either a string...
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