Fix YAML output not displaying in playground editor#16719
Merged
Conversation
Primer CSS's `d-flex` class applies `display: flex !important`, which overrides the inline `style.display = 'none'` set by JavaScript. The placeholder remained visible (computed display: flex) even after compilation, pushing the YAML output below the visible area where it was clipped by `overflow: hidden`. Switch to toggling Primer's `d-none`/`d-flex` utility classes instead of setting inline display styles, matching the pattern already used by the error/warning banners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a CSS specificity issue where the YAML output was not displaying in the playground editor after compilation. The root cause was that Primer CSS's d-flex class (which uses !important) was overriding the inline style.display = 'none' set by JavaScript on the placeholder div. The fix switches from inline style toggling to using Primer's d-none/d-flex utility classes, which also use !important and thus work correctly.
Changes:
- Modified display toggling for the output placeholder from inline styles to Primer utility classes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Primer CSS's `d-flex` class applies `display: flex !important`, which overrides the inline `style.display = 'none'` set by JavaScript. The placeholder remained visible (computed display: flex) even after compilation, pushing the YAML output below the visible area where it was clipped by `overflow: hidden`. Switch to toggling Primer's `d-none`/`d-flex` utility classes instead of setting inline display styles, matching the pattern already used by the error/warning banners. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
d-flexclass appliesdisplay: flex !important, which overrides the inlinestyle.display = 'none'set by JavaScript after compilationflex) despite the inline style sayingnone, pushing the YAML CodeMirror output below the visible container area whereoverflow: hiddenclipped itd-none/d-flexutility classes (which also use!important) instead of inline display styles, matching the pattern already used by the error/warning bannersRoot cause
Introduced in #16710 (CodeMirror migration). The old textarea-based editor used a
<pre>element withoutd-flex, so inline display toggling worked fine. The new placeholder div hasd-flexfor centering, creating the specificity conflict.Test plan
getComputedStyle(placeholder).displayreturns"flex"when it should be"none"🤖 Generated with Claude Code