-
Notifications
You must be signed in to change notification settings - Fork 48
Website - CodeBlock
height toggle docs
#2845
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CodeBlock
toggle code docsCodeBlock
height toggle docs
498b996
to
d992568
Compare
b679b47
to
f428cd6
Compare
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
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.
Nice improvements with these changes! A couple of small cleanup things, but I think this is looking good!
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
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 left a few non-blocking comments that add some consistency between the code docs and guidelines. Otherwise, this is looking solid!
website/docs/components/code-block/partials/guidelines/guidelines.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Jory Tindall <[email protected]>
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.
One quick resolution 🚀
@@ -69,6 +69,21 @@ Line numbers are displayed by default and can make longer blocks of code and sni | |||
In the Figma component, the code examples have the appropriate number of lines by default but must be manually hidden or shown to match the length of custom snippets. | |||
!!! | |||
|
|||
## Height toggle button | |||
|
|||
When displaying longer code snippets, it can be helpful to let users expand and collapse the content to save space in the UI. Setting a `maxHeight` on the Code Block limits how much is shown by default. If the content exceeds this height, a **Show more code** button will be displayed at the bottom of the block, allowing users to expand it. Interacting with the button again collapses the block back to its original height. |
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.
Working on tweaking this as it still seems a bit awkward... (I'll make a suggested edit)
@@ -69,6 +69,21 @@ Line numbers are displayed by default and can make longer blocks of code and sni | |||
In the Figma component, the code examples have the appropriate number of lines by default but must be manually hidden or shown to match the length of custom snippets. | |||
!!! | |||
|
|||
## Height toggle button | |||
|
|||
When displaying longer code snippets, it can be helpful to let users expand and collapse the content to save space in the UI. Setting a `maxHeight` on the Code Block limits how much is shown by default. If the content exceeds this height, a **Show more code** button will be displayed at the bottom of the block, allowing users to expand it. Interacting with the button again collapses the block back to its original height. |
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.
When displaying longer code snippets, it can be helpful to let users expand and collapse the content to save space in the UI. Setting a `maxHeight` on the Code Block limits how much is shown by default. If the content exceeds this height, a **Show more code** button will be displayed at the bottom of the block, allowing users to expand it. Interacting with the button again collapses the block back to its original height. | |
For longer code content, it can be helpful to set a `maxHeight` for the Code Block to limit how much code is shown by default within the UI layout. If the content exceeds this height, a “Show more code” button will be displayed at the bottom of the Code Block, allowing users to expand it. Activating this button again will collapse the content back to its original height. |
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.
@andgen404 How's this? (Above suggested edit)
📌 Summary
This PR adds docs to the website for the new
CodeBlock
toggle button from #2826.Preview link
🔗 External links
Jira ticket: HDS-4745
💬 Please consider using conventional comments when reviewing this PR.