Skip to content

fix: code padding in h2 titles#68

Merged
thetutlage merged 1 commit into
adonisjs:mainfrom
McSneaky:bugfix/code-in-title-whitespace
Jul 8, 2026
Merged

fix: code padding in h2 titles#68
thetutlage merged 1 commit into
adonisjs:mainfrom
McSneaky:bugfix/code-in-title-whitespace

Conversation

@McSneaky

@McSneaky McSneaky commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🔗 Linked issue

#64

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Attempt to fix hard readability when code is used within h2 titles

This is just bug trading tho. It makes code section inside h2 slightly more separated and readable, but at the same time adds whitespace to start of title, when it starts with code

It's not really solveable with just CSS, since there's no way to determine, if there is some text at start of h2 tag or not.
Next and previous sibling selectors ignore text nodes, so in CSS eyes, those to are same:

<h2>This is <code>code</code> in h2</h2>
<h2><code>This</code> is code in h2</h2>

Maybe there is some cool CSS trick, but I couldn't figure it out

Before:
image

After (notice missaligment in first title near Request and whitespaces around error):
image

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copilot AI review requested due to automatic review settings July 6, 2026 11:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the markdown typography styles to improve readability of inline <code> within h2 headings in the docs site.

Changes:

  • Updates the h2 code padding override to keep horizontal spacing while removing vertical padding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/css/markdown.css
@thetutlage thetutlage merged commit 550e526 into adonisjs:main Jul 8, 2026
@thetutlage

Copy link
Copy Markdown
Member

Thanks 👍🏽

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.

3 participants