Skip to content

fix: add spacing before Admin link in blog template#1968

Open
Cozmocat wants to merge 9 commits into
emdash-cms:mainfrom
Cozmocat:fix/blog-admin-nav-spacing
Open

fix: add spacing before Admin link in blog template#1968
Cozmocat wants to merge 9 commits into
emdash-cms:mainfrom
Cozmocat:fix/blog-admin-nav-spacing

Conversation

@Cozmocat

@Cozmocat Cozmocat commented Jul 12, 2026

Copy link
Copy Markdown

The Admin link currently renders directly after the final navigation item as PostsAdmin.

This adds spacing before the Admin link in the blog template while preserving the existing mobile layout.

The change is made in theme.css so it can flow to the Cloudflare template through the normal template sync.

What does this PR do?

Fixes the blog template navigation so the signed-in Admin link no longer renders directly after the final menu item as PostsAdmin.

Adds spacing through theme.css while preserving the existing mobile layout. The change can flow to the Cloudflare template through the normal template sync.

Type of change

  • Bug fix

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • No translation changes are required
  • No changeset is required for this CSS-only template fix

AI-generated code disclosure

  • This PR includes AI-generated code — Codex / GPT-5.6 Luna
  • I have read [CONTRIBUTING.md]

The Admin link currently renders directly after the final navigation item as `PostsAdmin`.

This adds spacing before the Admin link in the blog template while preserving the existing mobile layout.

The change is made in `theme.css` so it can flow to the Cloudflare template through the normal template sync.
@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 731b7ef

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.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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

@github-actions github-actions Bot added the review/needs-review No maintainer or bot review yet label Jul 12, 2026
@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is the right minimal fix for the stated layout problem. In templates/blog/src/layouts/Base.astro the .nav-admin link is a flex sibling that sits directly after .nav-right, so it renders flush against the last nav item. Adding margin-inline-start: var(--spacing-5) via CSS separates it cleanly while using an RTL-safe logical property, and the existing mobile media query already resets margin-inline-start: 0, so the mobile layout is preserved.

I verified the target class exists in both blog templates, that --spacing-5 is defined in tokens.css, and that this change is CSS-only so no changeset or Lingui update is needed. I did not run the test suite, linter, or formatter.

Two things to address before merge:

  1. Formatting — the new CSS is indented with spaces; this project uses tabs everywhere and pnpm format is part of the pre-PR checklist. Run the formatter on templates/blog/src/styles/theme.css.
  2. Cloudflare varianttemplates/blog-cloudflare/src/styles/theme.css still lacks the rule. Either apply the same addition there or run ./scripts/sync-cloudflare-templates.sh so the checked-in Cloudflare template is actually fixed, as the PR description implies.

Comment thread templates/blog/src/styles/theme.css Outdated

/* Keep the signed-in Admin link separated from the primary navigation. */
.nav-admin {
margin-inline-start: var(--spacing-5);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[needs fixing] The new .nav-admin declaration is indented with two spaces, but the project convention (and .oxfmtrc.json / .prettierrc) is tabs. The whole file is currently spaces, so run pnpm format to convert it rather than committing more space-indented CSS.

Suggested change
margin-inline-start: var(--spacing-5);
.nav-admin {
margin-inline-start: var(--spacing-5);
}

}

/* Keep the signed-in Admin link separated from the primary navigation. */
.nav-admin {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[suggestion] This fixes templates/blog, but templates/blog-cloudflare/src/styles/theme.css still has no .nav-admin spacing rule at the PR head. Since the description says the change should flow to the Cloudflare template, either run ./scripts/sync-cloudflare-templates.sh now or apply the same .nav-admin { margin-inline-start: var(--spacing-5); } addition to templates/blog-cloudflare/src/styles/theme.css so the checked-in variant isn't left with the original spacing bug.

@Cozmocat

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jul 12, 2026
@github-actions github-actions Bot added review/needs-rereview Author pushed changes since the last review and removed review/needs-review No maintainer or bot review yet labels Jul 12, 2026
Cozmocat added 7 commits July 12, 2026 16:20
Use the repository’s tab-based indentation for the Admin navigation spacing rule.
Apply the same Admin navigation spacing rule to the Cloudflare blog template as requested by the PR review.
Apply the same Admin navigation spacing rule to the Cloudflare blog template as requested by the PR review.
Format the Admin navigation spacing rule with the repository-standard tab indentation in both blog theme.css files. No behavior change.
Match the Cloudflare blog template’s Admin navigation rule to the repository’s tab indentation convention. No behavior change.
Match the Cloudflare blog template’s Admin navigation rule to the repository’s tab indentation convention. No behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/templates cla: signed review/needs-rereview Author pushed changes since the last review size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant