-
-
Notifications
You must be signed in to change notification settings - Fork 9k
fix(theme-classic): add outline to focused code blocks #6121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✔️ [V2] 🔨 Explore the source changes: 267caa1 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61bcdc1ce73b010007bf0b9f 😎 Browse the preview: https://deploy-preview-6121--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6121--docusaurus-2.netlify.app/ |
The original issue was reproducible on Firefox where |
I can confirm outline on FF works better now. Comparing:
I can't see any issue so far, not sure why I added this overflow hidden anymore 🤷♂️ |
@@ -9,7 +9,6 @@ | |||
margin-bottom: var(--ifm-leading); | |||
border-radius: var(--ifm-global-radius); | |||
box-shadow: var(--ifm-global-shadow-lw); | |||
overflow: hidden; |
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.
apparently I added this in #5215, don't remember why 😅 hope it's safe to remove
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.
I realized what overflow: hidden
does... Because if we set border radius on the parent container but child is still a regular rectangle, the child overflows and makes the code block still appear as a sharp-edged rectangle. The reason that the highlight doesn't appear on FF is also because they treat the highlight as part of overflow and gets hidden
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.
Ah yes, I remember that was related to border-radius now 😅 it was simpler to add radiuses on the container than on the individual items, particularly when the live codeblock playground/result positions are configurable
Motivation
Fixes #6077
Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
Run
yarn start:website
and go to http://localhost:3000/docs/next/installation#scaffold-project-website. When focusing on the code block, it should like below:Firefox

Chrome
