-
Notifications
You must be signed in to change notification settings - Fork 648
feature/code-block-language-header #1389
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
feature/code-block-language-header #1389
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
687d1c2 to
f50584c
Compare
| } | ||
|
|
||
| .Container section :global(.code-block-header) { | ||
| @apply hidden !important; |
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.
question: is there a way to do this without the !important?
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 struggled to get this apply. I tried hiding it at different levels, using different selectors, but had to end up with !important, but I could have missed something.
sfc-gh-nbellante
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.
LGTM 👍
|
|
||
| const Header = ( | ||
| <div className={classNames(styles.Header, "code-block-header")}> | ||
| {showLanguage && ( |
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.
question: If showLanguage is false, then it looks like Header will just be a blank div with a height of 2.5rem. Is that expected?
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.
The copy button should still be visible. (After the feature is merged, this should be a rare case because I will update the docs. IIRC, I will only use "None" for directory structures or text files, and I will add a "Directory structure" description or "requirements.txt" in those instances, which is the next PR.)
For example, this is a "None" example that will have a description enabled in the next PR.

* Fix code block copy button * Add custom code style for RefCard * Change code blocks with theme * Unify syntax highlighting color; update light mode * feature/code-block-language-header (#1389) * feature/code-block-language-header * Include none language * Debug none language * Hide language when none * Use right padding * Add header to Autofunctio code * feature/code-block-description (#1390) * feature/code-block-description * Filename color * Replace language with filename; optionally both * Revert content changes * Revert more content changes * feature/try-it-code-block-button (#1391) * feature/code-block-description * Filename color * Replace language with filename; optionally both * Revert content changes * Revert more content changes * feature/try-it-code-block-button * Use named target * Design edits * Fix gray code header in dark mode * Remove filename * Design tweaks * Update Autofunction code block to match * Fix the font-family used in inline code. * Update styling for code blocks. * Unrelated but make radius of Kapa dialog nicer. * Unrelated but fix arrows and padding in component slider. * Refactor <Code> and add nicer timeout for copy button * Add example of code block without header. * Fix hydration errors. * Rename Bash->Terminal in code blocks. * Fix rebase errors and improve design of `try it` button * Fix bug where copy button wasn't showing. This will lead to hydration errors, though * Add comment. * Fix ref cards * Add hideHeader boolean flag --------- Co-authored-by: Thiago Teixeira <[email protected]>

📚 Context
🧠 Description of Changes
Current:
Insert screenshot of existing UI/code here
Revised:
Insert screenshot of your updated UI/code here
💥 Impact
Size:
🌐 References
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.