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.

It's currently not possible to add a focus effect (like box-shadow) to a link

See original GitHub issue

Description

When I add a _focus style including a shadow to a link, I expect that style to be applied

Link to Reproduction

https://codesandbox.io/s/dazzling-haibt-vnr6u?file=/src/index.tsx

Steps to reproduce

  1. Add a link with a shadow
  2. Add the shadow to the _focus styles, too
  3. Click the link but make sure the link stays on page (this happens a lot in a Next.js app)
  4. The shadow disappears, and there is no way to keep it

Chakra UI Version

1.8.3

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

Add :not(.always-show-focus) or something to the CSS reset and this is fixed immediately! Document the ability to do this, too. Perhaps generally the focus ring should be documented separately? I’m happy to write that if you want.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tomhickscommented, Feb 18, 2022

I’m going to create a PR I think - it’s an easy fix and should be perfectly backwards compatible.

0reactions
stale[bot]commented, Apr 16, 2022

Hi! This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs within 5 days. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

box-shadow - CSS: Cascading Style Sheets - MDN Web Docs
The box-shadow CSS property adds shadow effects around an element's frame. ... If not specified, it will be 0 (the shadow's edge is...
Read more >
How to achieve this effect on :focus - Stack Overflow
The text box is using a CSS3 box-shadow :. The CSS below will put the shadow effect on all text boxes on focus:...
Read more >
box-shadow - CSS-Tricks
The box-shadow property in CSS is for putting shadows on elements (sometimes referred to as "drop shadows", ala Photoshop/Figma).
Read more >
Box shadow for focus on element with border - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >
Apply shadow or blur effects – Figma Help Center
They can enable you to signify that an element is interactive, like making ... As it's not possible to re-order effects, we recommend...
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