Skip to content

Conversation

@sfc-gh-dmatthews
Copy link
Contributor

📚 Context

🧠 Description of Changes

Current:

Insert screenshot of existing UI/code here

Revised:

Insert screenshot of your updated UI/code here

💥 Impact

Size:

  • Small
  • Not small

🌐 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.

@sfc-gh-dmatthews
Copy link
Contributor Author

sfc-gh-dmatthews commented Dec 14, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sfc-gh-dmatthews sfc-gh-dmatthews force-pushed the 12-14-feature_code-block-language-header branch from 687d1c2 to f50584c Compare December 17, 2025 07:30
@sfc-gh-dmatthews sfc-gh-dmatthews marked this pull request as ready for review December 17, 2025 15:35
}

.Container section :global(.code-block-header) {
@apply hidden !important;

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?

Copy link
Contributor Author

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.

Copy link

@sfc-gh-nbellante sfc-gh-nbellante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@sfc-gh-dmatthews sfc-gh-dmatthews added the javascript Pull requests that update Javascript code label Dec 18, 2025

const Header = (
<div className={classNames(styles.Header, "code-block-header")}>
{showLanguage && (
Copy link
Contributor

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?

Copy link
Contributor Author

@sfc-gh-dmatthews sfc-gh-dmatthews Dec 19, 2025

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.
image

@sfc-gh-dmatthews sfc-gh-dmatthews merged commit ea1093b into fix/code-block-copy Dec 19, 2025
@sfc-gh-dmatthews sfc-gh-dmatthews deleted the 12-14-feature_code-block-language-header branch December 19, 2025 18:37
sfc-gh-dmatthews added a commit that referenced this pull request Jan 9, 2026
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants