Skip to content

fix(frontend): style h6 and drop unused markdown CSS variables - #861

Merged
unhappychoice merged 1 commit into
mainfrom
fix/markdown-h6-and-dead-css-vars
Jul 27, 2026
Merged

unhappychoice merged 1 commit into
mainfrom
fix/markdown-h6-and-dead-css-vars

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Jul 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

Addresses two of the three points raised in #857.

  • h6 had no rule at all, so it missed the margin / font-weight treatment shared by h1 through h5. Merged into the h4 / h5 rule, which already had byte-identical declarations.
  • Removed --markdown-pre-background-color and --markdown-code-background-color. Both were declared in :root and [data-theme="dark"] but referenced zero times.

Why the variables are removed rather than wired up

The issue suggests wiring the two variables into .markdown-body pre / .markdown-body code. That would conflict with how code rendering actually works today.

  • Code blocks are rendered by PrismAsyncLight in MarkdownCode.tsx, which applies the style of the syntax highlighter theme the user selects in Settings.
  • Inline code takes its background from syntaxHighlighterThemeMeta.color in the same component.

Both follow the selected syntax highlighter theme by design, so a CSS background would fight the user's choice. The variables are leftovers from before that behavior moved into the component.

Heading colors are intentionally left alone

The third point in the issue, adding a color to headings, is not included. The current CSS conveys hierarchy through font size plus a border-bottom on h1 / h2, which matches the convention GitHub's own Markdown rendering uses. Discussion continues on the issue.

Visual impact

h6 only. It moves from browser defaults to the same treatment as h4 / h5. Nothing else changes, since the removed variables had no effect.

Refs #857

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style
    • Updated Markdown heading styles for more consistent formatting across lower-level headings.
    • Adjusted Markdown color handling, including code blocks and dark theme presentation.

h6 had no rule at all, so it missed the shared margin and font-weight
that h1 through h5 share. Merge it into the h4/h5 rule, which already
had identical declarations.

Also remove --markdown-pre-background-color and
--markdown-code-background-color. Both were declared in :root and
[data-theme="dark"] but never referenced. Code block and inline code
backgrounds come from the selected syntax highlighter theme in
MarkdownCode.tsx, so wiring these variables up would conflict with it.

Refs #857

Co-Authored-By: Claude Opus 5 <[email protected]>
@netlify

netlify Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for mdts-unhappychoice ready!

Name Link
🔨 Latest commit c0fd12b
🔍 Latest deploy log https://app.netlify.com/projects/mdts-unhappychoice/deploys/6a673617207a990008b7cf0c
😎 Deploy Preview https://deploy-preview-861--mdts-unhappychoice.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2bae4e9c-5e98-42d6-8965-b2040e502665

📥 Commits

Reviewing files that changed from the base of the PR and between 1c22012 and c0fd12b.

📒 Files selected for processing (1)
  • packages/frontend/public/markdown.css

📝 Walkthrough

Walkthrough

The markdown stylesheet removes pre/code background variables from theme declarations and consolidates shared styling for h4, h5, and h6 headings.

Changes

Markdown CSS cleanup

Layer / File(s) Summary
Theme variables and heading styles
packages/frontend/public/markdown.css
Removes markdown pre/code background variables and groups shared h4–h6 heading styles under one selector.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: h6 styling and removal of unused Markdown CSS variables.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/markdown-h6-and-dead-css-vars

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/frontend/public/markdown.css

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.19%. Comparing base (e908e47) to head (c0fd12b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #861   +/-   ##
=======================================
  Coverage   99.19%   99.19%           
=======================================
  Files          70       70           
  Lines        1616     1616           
  Branches      387      387           
=======================================
  Hits         1603     1603           
  Misses         12       12           
  Partials        1        1           
Flag Coverage Δ
frontend 99.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@unhappychoice
unhappychoice merged commit 0267328 into main Jul 27, 2026
9 checks passed
@unhappychoice
unhappychoice deleted the fix/markdown-h6-and-dead-css-vars branch July 27, 2026 10:46
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.

1 participant