-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Update Expandable to use native <details> element
#13168
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
This has some important benefits: 1. It should be covered by search etc. as this is statically rendered now and just "hidden" via CSS. 2. The browser automatically searches in it when using CMD+F - it will auto-open respective details that contain the searched content.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
Bundle ReportChanges will increase total bundle size by 2.28kB (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
Files in
App Routes Affected:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
Files in
|
lforst
left a comment
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.
<3 love me some cmd-f
| border: 0; | ||
| border-radius: 4px; | ||
| margin: 0 0 1rem; | ||
| margin: 0; |
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.
Just curious, why are we getting rid of the bottom-margin here?
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.
sorry, should have explained: This was a bit hard to work with, as this element is nested in a bunch of other divs, making it impossible to remove this, basically. Also, as far as I've seen this is always in another div that also has margin, so this was redundant - I scanned a bunch of pages and it did not seem to affect the styling, so hopefully this is good 🤞
Without this change, having a code block in an expandable (see example in the component page) looked weird because there was always a margin on bottom.
The
<details>element is a native HTML element that handles expanding/collapsing out of the box. This is more accessible, and has some additional important benefits for us: