Skip to content

fix(admin): stop forcing every border to the default gray - #4118

Merged
khoinguyenpham04 merged 4 commits into
mainfrom
noah/admin-border-colors
Oct 12, 2026
Merged

khoinguyenpham04 merged 4 commits into
mainfrom
noah/admin-border-colors

Conversation

@khoinguyenpham04

@khoinguyenpham04 khoinguyenpham04 commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes admin borders always being drawn in the default gray, even where a component asks for another color.

packages/admin/src/styles.css set * { border-color: var(--color-kumo-line) } outside Tailwind's cascade layers. Unlayered CSS beats every layered rule regardless of specificity, so this rule overrode every border-* color class in the admin, including Kumo's own. I noticed it on the empty Featured Image drop target: while a file is dragged over it, the box gets border-kumo-brand bg-kumo-tint, but only the tint showed and the border stayed gray.

The rule now sits in @layer base. Elements without a border color class still get --color-kumo-line in light and dark mode, and border color classes now win. Apart from the rule's position, the compiled stylesheet is unchanged.

What changes on screen:

  • Status notices get their colors: error, warning, info and success notices that have a border now show it in red, yellow, blue or green instead of gray, and so do the colored accent bars on the WordPress import page. Kumo Banner notices have no border and don't change.
  • Blue borders show where components ask for them: the Featured Image and OG Image drop targets and the media library's drop overlay while a file is dragged over them, the selected revision in the Revisions panel, and the migration key box on the WordPress import page. A revision's listed changes get green, red or amber outlines.
  • The expanded sidebar no longer draws a line under Content, Manage, Admin and Plugins. This is intentional. Kumo's sidebar makes those lines transparent while the sidebar is expanded, where the labels already separate the groups, and shows them only when the sidebar is collapsed to icons. They appeared in the expanded sidebar only because of this bug, and the collapsed sidebar still shows them.
  • A few grays shift by a shade: Kumo tabs, table cell lines, outline badges and divide-kumo-line/50 dividers now use their own grays.

The Visual Regression screenshots still match their baselines, because the sidebar lines and gray shifts are below its per-pixel tolerance.

Type of change

  • Bug fix
  • Feature (requires an accepted feature plan or RFC)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Your connection to this change

  • I use EmDash and ran into the problem this PR addresses
  • I maintain a tool, dependency, or service that EmDash uses, and this change concerns that integration
  • A Maintainer approved this specific change before I opened the PR

Checklist

  • I have read CONTRIBUTING.md
  • 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)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main. Not applicable: no strings changed.
  • I have added and reviewed the user-facing changeset (if this PR changes a published package)
  • New features link to their merged design PR: https://github.com/emdash-cms/emdash/pull/... Not applicable: bug fix.
  • I have included screenshots below if this PR changes the UI

AI assistance disclosure

  • This PR includes AI-generated code or text — model/tool: Claude Opus 5.5

Screenshots / test output

Before: while a file is dragged over the empty Featured Image box, the background tints but the dashed border stays gray.

Featured Image drop target while a file is dragged over it, before the fix, with a tinted background and a gray dashed border

After: the border turns blue.

The same drop target after the fix, with a blue dashed border

Before: the media library's drop overlay has a gray dashed frame.

Media library while files are dragged over the page, before the fix, with a gray dashed frame around the Drop files to upload overlay

After: the frame is blue.

The same media library overlay after the fix, with a blue dashed frame

Before: the selected revision has a faint blue fill but a gray outline.

Revisions panel with the second revision selected, before the fix, with a faint blue fill and a gray outline

After: the selected revision has a blue outline.

The same Revisions panel after the fix, with a blue outline on the selected revision

Before: notices have a gray edge. Here, the error shown when users fail to load, and the invite link warning shown when no email provider is configured.

Users page error notice reading Failed to load users: Database is unavailable, before the fix, with a pale gray border around the pink box

Invite Link Created dialog before the fix, with a yellow Share this link with the invited user notice that has a pale gray border

After: the edges are red and yellow.

The same users page error notice after the fix, with a red border

The same Invite Link Created dialog after the fix, with a yellow border around the notice

Before: the expanded sidebar draws a line under each section label.

Expanded admin sidebar before the fix, with a gray line under the Content and Manage labels

After: the expanded sidebar has no lines under the labels, as Kumo intends.

Expanded admin sidebar after the fix, with the Content and Manage labels and no lines under them

Every spot I compared, in light and dark mode

Side-by-side before and after pairs for the Featured Image drop target in light and dark mode, the media library drop overlay, the selected revision, and the WordPress import migration key box, each with a gray border before and a blue one after

Side-by-side before and after pairs for the expanded sidebar in light and dark mode, with lines under the section labels before and none after, and a bylines table whose row lines turn a slightly different gray

Tests:

  • packages/admin/tests/components/ImageDropTargets.test.tsx: the drop target's border is the brand color while a file is dragged over it. The test fails against main's stylesheet, where the border keeps the line color, and passes with the fix.
  • The full admin suite passes (233 files, 3,304 tests).
  • I compared computed border colors on 21 admin pages in light and dark mode, before and after. Elements without a border color class keep --color-kumo-line; every difference comes from a border color class that now applies. The notice screenshots used mocked API responses to show the error and invite link states.

The admin stylesheet set `* { border-color: var(--color-kumo-line) }`
outside Tailwind's cascade layers. Unlayered rules beat layered ones
regardless of specificity, so every border color utility in the admin,
Kumo's included, drew the default gray instead. Moving the rule into
`@layer base` keeps the default for elements without a border color
class and lets the utilities win.
@changeset-bot

changeset-bot Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9219a17

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/plugin-test Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
create-emdash Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

Not sure what this means? Click here to learn what changesets are.

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://noah-admin-border-colors.try.emdashcms.com, https://noah-admin-border-colors-emdash-playground.emdash-cms.workers.dev (commit 9219a17)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ac01c782.try.emdashcms.com, https://ac01c782-emdash-playground.emdash-cms.workers.dev 9219a17 2026-10-12T22:56:30.131Z Visit the dashboard ↗
  • Build: In progress 🔵

View logs ↗
3079e61 2026-10-12T22:50:44.185Z View logs ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9a4067e5.try.emdashcms.com, https://9a4067e5-emdash-playground.emdash-cms.workers.dev 687e9c5 2026-10-12T12:06:58.623Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://948e7702.try.emdashcms.com, https://948e7702-emdash-playground.emdash-cms.workers.dev 18e2861 2026-10-11T21:19:15.356Z Visit the dashboard ↗

@github-actions github-actions Bot added area/admin size/S review/needs-review No maintainer or bot review yet labels Oct 11, 2026

@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 PR fixes the issue correctly and with minimal scope. The unlayered * { border-color: var(--color-kumo-line) } rule in packages/admin/src/styles.css was indeed overriding every Tailwind border-* color utility regardless of specificity, because unlayered CSS always wins over layered CSS. Moving the rule into @layer base is the right, idiomatic Tailwind v4 fix: the universal selector keeps its zero specificity within the base layer, so utilities in higher layers (and with higher specificity) now win as intended. Elements without an explicit border color class still fall back to --color-kumo-line, preserving the original default behavior.

The regression test in ImageDropTargets.test.tsx is well targeted: it exercises the actual broken user-visible behavior (the Featured Image drop target should show a brand-colored border while a file is dragged over it) by asserting the computed borderTopColor, not by asserting class names. It would fail against main's stylesheet and passes with the fix. The changeset is user-facing, specific about observable effects, and follows .changeset/README.md conventions.

I checked the changed CSS, the drop-target component, the test setup, and the changeset. There are no logic bugs, API changes, security concerns, localization issues, RTL issues, or comment/AGENTS.md violations introduced here. The PR is clean.

@emdashbot emdashbot Bot added review/needs-review No maintainer or bot review yet and removed review/needs-review No maintainer or bot review yet labels Oct 11, 2026
@github-actions github-actions Bot added the query-count changed PR diff modifies query-count snapshot files label Oct 11, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@4118

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@4118

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@4118

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@4118

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@4118

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@4118

emdash

npm i https://pkg.pr.new/emdash@4118

create-emdash

npm i https://pkg.pr.new/create-emdash@4118

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@4118

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@4118

@emdash-cms/plugin-test

npm i https://pkg.pr.new/@emdash-cms/plugin-test@4118

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@4118

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@4118

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@4118

@emdash-cms/registry-loader

npm i https://pkg.pr.new/@emdash-cms/registry-loader@4118

@emdash-cms/registry-moderation

npm i https://pkg.pr.new/@emdash-cms/registry-moderation@4118

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@4118

upgrade-emdash

npm i https://pkg.pr.new/upgrade-emdash@4118

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@4118

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@4118

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@4118

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@4118

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@4118

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@4118

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@4118

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@4118

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@4118

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@4118

commit: 9219a17

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs 687e9c5 Oct 12 2026, 12:05 PM

@github-actions github-actions Bot added cla: needed and removed query-count changed PR diff modifies query-count snapshot files labels Oct 12, 2026
@khoinguyenpham04
khoinguyenpham04 merged commit 6524921 into main Oct 12, 2026
39 checks passed
@khoinguyenpham04
khoinguyenpham04 deleted the noah/admin-border-colors branch October 12, 2026 23:09
@emdashbot emdashbot Bot mentioned this pull request Oct 12, 2026
Zahid09987 pushed a commit to Zahid09987/emdash that referenced this pull request Oct 17, 2026
…#4118)

* fix(admin): stop forcing every border to the default gray

The admin stylesheet set `* { border-color: var(--color-kumo-line) }`
outside Tailwind's cascade layers. Unlayered rules beat layered ones
regardless of specificity, so every border color utility in the admin,
Kumo's included, drew the default gray instead. Moving the rule into
`@layer base` keeps the default for elements without a border color
class and lets the utilities win.

* chore: simplify the border color changeset

* chore: shorten the border color changeset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant