Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 20, 2025

Fixed inconsistent code styling in the Patternhub documentation site that was causing different appearance between code examples on "Overview" and "How to use" pages.

Issues Fixed

  1. Background inconsistency: Shell code blocks (language-shell) were excluded from getting transparent backgrounds, causing them to appear with black backgrounds while other code blocks had white/transparent backgrounds
  2. Font inconsistency: Monospace font family was not consistently applied to all <code> elements within <pre> blocks
  3. Cross-page styling differences: Code examples looked different between different documentation pages

Changes Made

Updated showcases/patternhub/styles/highlight.scss:

  • Removed the :not(:has(.language-shell)) exclusion from the CSS selector
  • Added explicit font-family: monospace for both pre and code elements
  • Ensured all code blocks with .hljs class get consistent transparent backgrounds

Before/After

Before: Shell code blocks had black backgrounds while JavaScript/CSS code blocks had transparent backgrounds, creating visual inconsistency.

After: All code blocks now have consistent styling with proper monospace fonts and uniform backgrounds.

Code Styling Test

The screenshot demonstrates the fix working correctly - all code blocks now display with consistent monospace fonts and appropriate background styling.

Fixes #4221.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link

changeset-bot bot commented Aug 26, 2025

⚠️ No Changeset found

Latest commit: da69798

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mfranzke
Copy link
Collaborator

@copilot please try again

Copy link
Contributor Author

Copilot AI commented Aug 31, 2025

@copilot please try again

I've successfully fixed the code styling inconsistencies in the Patternhub documentation. The issue was in showcases/patternhub/styles/highlight.scss where shell code blocks were excluded from getting transparent backgrounds, and monospace fonts weren't consistently applied.

Changes made:

  • Removed the :not(:has(.language-shell)) exclusion so all code blocks get consistent transparent backgrounds
  • Added explicit font-family: monospace for both pre and code elements
  • Ensured uniform styling across all code examples

All tests pass and the fix addresses the reported issues. Commit: 70cc058

@Copilot Copilot AI changed the title [WIP] Docs: give the style of the code examples some love Fix code styling consistency in Patternhub documentation Aug 31, 2025
Copilot finished work on behalf of mfranzke August 31, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: give the style of the code examples some love
2 participants