Skip to content

chore: reduced margin above H3#1235

Open
aaguiarz wants to merge 2 commits intomainfrom
fix/reduce-h3
Open

chore: reduced margin above H3#1235
aaguiarz wants to merge 2 commits intomainfrom
fix/reduce-h3

Conversation

@aaguiarz
Copy link
Copy Markdown
Member

@aaguiarz aaguiarz commented Apr 12, 2026

Description

What problem is being solved?

The margin above H3 ('###') was too big:

Before
image

After
image

How is it being solved?

What changes are made to solve it?

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Summary by CodeRabbit

  • Style
    • Adjusted vertical spacing for H3 headings in markdown content.

@aaguiarz aaguiarz requested a review from a team as a code owner April 12, 2026 03:45
Copilot AI review requested due to automatic review settings April 12, 2026 03:45
@aaguiarz aaguiarz requested a review from a team as a code owner April 12, 2026 03:45
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fd9af0fa-3300-4ea7-a390-dafeb5282271

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Added a CSS rule targeting .markdown h3 elements to adjust their top margin using a calculated value that subtracts 50px from the base heading margin top variable, modifying vertical spacing for H3 headings in markdown content.

Changes

Cohort / File(s) Summary
CSS Styling
src/css/custom.css
Added new CSS rule for .markdown h3 elements to adjust top margin with calc(var(--ifm-heading-margin-top) - 50px) for custom vertical spacing.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • curfew-marathon
  • ewanharris
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 change: reducing margin above H3 headings, which directly corresponds to the CSS modification in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reduce-h3

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 and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reduces the vertical spacing above Markdown H3 headings to improve readability and reduce excessive whitespace in rendered documentation content.

Changes:

  • Adds a custom CSS rule targeting .markdown h3 to decrease top margin.

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

Comment thread src/css/custom.css
Comment on lines +44 to +46
.markdown h3 {
margin-top: calc(var(--ifm-heading-margin-top) - 50px);
}
Copy link

Copilot AI Apr 12, 2026

Choose a reason for hiding this comment

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

The 50px adjustment is an unexplained magic number. To make this easier to tune/maintain (and to keep spacing resilient if Infima’s default heading margins change), consider extracting this into a named CSS custom property (e.g., --ofga-markdown-h3-margin-top-adjustment) or adding a short comment explaining how the value was chosen.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://openfga.github.io/openfga.dev/pr-preview/pr-1235/

Built to branch gh-pages at 2026-04-12 14:12 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/css/custom.css (1)

44-46: Consider using a CSS variable for the reduction value.

The hardcoded 50px value reduces maintainability. If you need to adjust this spacing later or want to make it theme-dependent, defining it as a CSS variable would be more flexible.

♻️ Proposed refactor using a CSS variable
 :root {
   --ifm-color-primary: `#2e8555`;
   --ifm-color-primary-dark: `#29784c`;
   --ifm-color-primary-darker: `#277148`;
   --ifm-color-primary-darkest: `#205d3b`;
   --ifm-color-primary-light: `#33925d`;
   --ifm-color-primary-lighter: `#359962`;
   --ifm-color-primary-lightest: `#3cad6e`;
   --ifm-code-font-size: 95%;
   --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
   --ifm-pre-padding: 2rem;
   --ifm-navbar-height: 6.5rem;
+  --custom-h3-margin-reduction: 50px;
 }

Then update the rule:

 .markdown h3 {
-  margin-top: calc(var(--ifm-heading-margin-top) - 50px);
+  margin-top: calc(var(--ifm-heading-margin-top) - var(--custom-h3-margin-reduction));
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/css/custom.css` around lines 44 - 46, Replace the hardcoded "50px" in the
".markdown h3" rule with a new CSS variable (e.g. --markdown-heading-offset) so
the reduction is configurable; define that variable at a global scope like :root
(or the theme/root selector you use) with a default value (e.g. 50px) and update
the rule to use calc(var(--ifm-heading-margin-top) -
var(--markdown-heading-offset)) so future tweaks or theme overrides can adjust
spacing without changing the selector itself.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/css/custom.css`:
- Around line 44-46: The .markdown h3 rule currently sets margin-top using
calc(var(--ifm-heading-margin-top) - 50px) which can go negative; update the
.markdown h3 selector to clamp the computed value using max() so the margin-top
is the greater of 0px and the current calc expression (i.e., use max(0px,
calc(var(--ifm-heading-margin-top) - 50px))) to prevent negative margins and
layout overlap.

---

Nitpick comments:
In `@src/css/custom.css`:
- Around line 44-46: Replace the hardcoded "50px" in the ".markdown h3" rule
with a new CSS variable (e.g. --markdown-heading-offset) so the reduction is
configurable; define that variable at a global scope like :root (or the
theme/root selector you use) with a default value (e.g. 50px) and update the
rule to use calc(var(--ifm-heading-margin-top) - var(--markdown-heading-offset))
so future tweaks or theme overrides can adjust spacing without changing the
selector itself.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2cfe590-9446-48cf-b532-f9d8252d6520

📥 Commits

Reviewing files that changed from the base of the PR and between 671d560 and 26d9a79.

📒 Files selected for processing (1)
  • src/css/custom.css

Comment thread src/css/custom.css
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.

2 participants