fix(ui): correct dark-mode heading/paragraph colours and add PageHeadingComponent#295
Conversation
- Extracted shared base styles (inline-flex, cursor-pointer, focus-visible ring, disabled:opacity-50, active:scale) into a grouped selector for all four button variants. - .btn-primary: added cursor-pointer, focus ring, disabled & active states. - .btn-secondary: normalised to rounded-md, border-primary-400/500, bg-transparent, same interactive states as primary. - .btn-warning (NEW): amber-400/500 fixed palette, amber-950 text for contrast (Bootstrap btn-warning style — caution / non-destructive). - .btn-destructive (NEW): red-600/500 fixed palette, white text (Bootstrap btn-danger feel — irreversible delete actions). - ConfirmDeleteDialog: migrated hardcoded red/grey inline Tailwind to .btn-destructive / .btn-secondary. - ProfileTests: updated 3 badge-colour assertions to match pre-existing Profile.razor solid-colour badge refactor on this branch. Closes #292 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Delete button in Index.razor was using hardcoded Tailwind utilities (bg-red-600, hover:bg-red-700, etc.) while ConfirmDeleteDialog already used the shared .btn-destructive utility class from input.css. This inconsistency meant the two delete surfaces had different hover, focus, dark-mode, and spacing behaviour. - Replace raw Tailwind classes on the inline Delete button with btn-destructive - Add bUnit test BlogIndexUsesBtnDestructiveForInlineDeleteButton to RazorSmokeTests to prevent regression Architecture.Tests: 16/16 Web.Tests.Bunit: 74/74 Closes #292 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ingComponent - Fix h1/h2/h3 dark-mode text: dark:text-primary-950 → dark:text-primary-50 (near-black text on near-black background was invisible in dark mode) - Fix p dark-mode text: dark:text-primary-950 → dark:text-primary-200 - Centralise button variants (primary/secondary/warning/destructive) and nav styling into input.css; remove duplicate inline Tailwind classes from NavMenu, MainLayout, and feature components - Add shared PageHeadingComponent.razor; wire via _Imports.razor - Adopt tab-indented formatting across all modified Razor files Closes #291 Closes #292 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🏗️ PR Added to Squad Triage QueueThis PR has been labeled with Next steps:
|
There was a problem hiding this comment.
Pull request overview
Fixes dark-mode typography regressions and continues the UI style consolidation by centralizing common Tailwind component classes and introducing a reusable page heading component across feature pages.
Changes:
- Corrects base dark-mode heading/paragraph colors and expands shared component styles in
input.css(nav, buttons, cards/tables/forms). - Adds
PageHeadingComponentand replaces per-page<PageTitle>/<h1>usage with the shared component. - Updates and expands bUnit coverage to lock in the new shared button-variant class usage and updated badge classes.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Web.Tests.Bunit/Features/ProfileTests.cs | Updates badge class assertions to match new solid badge styling in Profile. |
| tests/Web.Tests.Bunit/Components/RazorSmokeTests.cs | Adds bUnit assertions for shared button variant classes across key pages/components. |
| src/Web/Styles/input.css | Adjusts base typography colors and centralizes nav/button/card/table/form styling via Tailwind @apply. |
| src/Web/Features/UserManagement/Profile.razor | Adopts PageHeadingComponent, centralizes card/table styling, updates role badge styling. |
| src/Web/Features/UserManagement/ManageRoles.razor | Adopts PageHeadingComponent and simplifies markup styling to rely on shared CSS. |
| src/Web/Features/BlogPosts/List/Index.razor | Adopts PageHeadingComponent and replaces inline delete styling with btn-destructive. |
| src/Web/Features/BlogPosts/Edit/Edit.razor | Adopts PageHeadingComponent and shared button variants. |
| src/Web/Features/BlogPosts/Delete/ConfirmDeleteDialog.razor | Replaces inline delete/cancel button classes with shared btn-destructive / btn-secondary. |
| src/Web/Features/BlogPosts/Create/Create.razor | Adopts PageHeadingComponent and shared form/button variants. |
| src/Web/Features/_Imports.razor | Imports shared components namespace for feature pages. |
| src/Web/Components/Shared/PageHeadingComponent.razor | Introduces reusable heading + PageTitle wrapper component. |
| src/Web/Components/Layout/NavMenu.razor | Moves nav styling to centralized CSS (removes inline Tailwind block). |
| src/Web/Components/Layout/MainLayout.razor | Adjusts layout background and formatting. |
| .squad/agents/legolas/history.md | Adds UI learnings notes for button variants / destructive consistency. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #295 +/- ##
==========================================
+ Coverage 86.21% 87.20% +0.98%
==========================================
Files 44 45 +1
Lines 1103 1118 +15
Branches 132 137 +5
==========================================
+ Hits 951 975 +24
+ Misses 100 93 -7
+ Partials 52 50 -2
🚀 New features to boost your workflow:
|
…NavMenu Thread 1 (input.css): Fix misleading .btn-secondary comment; it is a solid blue button, not outline. Update comment to match implementation. Thread 2 (input.css): Add mx-auto px-4 to .container-card so it provides proper centering and padding as a shared layout container. Thread 3 (PageHeadingComponent): Add default switch arm that falls back to h1 so unexpected Level values render predictably instead of silently. Thread 4 (Profile.razor): Remove redundant @using MyBlog.Web.Components.Shared already covered by _Imports.razor. Thread 5 (NavMenu.razor): Remove unused class=nav from nav element; CSS styles nav via element selector, not class selector. Thread 6 (history.md): Correct the learning note that falsely claimed btn-primary / btn-secondary use var(--primary-*) tokens. All four variants use fixed Tailwind palette classes (green / blue / amber / red). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Gate Decision: APPROVED for squash merge CI green (all 19 checks), Codecov passing, all 6 Copilot inline threads resolved. PageHeadingComponent centralises heading markup correctly; btn-* utilities properly consolidated in input.css; dark-mode palette fix (text-primary-50) is correct. |
Summary
Fixes two visual regressions introduced on this branch and completes the input.css fine-tuning work.
Changes
input.css— corrected dark-mode text colours forh1/h2/h3(dark:text-primary-950→dark:text-primary-50) andp(dark:text-primary-950→dark:text-primary-200). Near-black text on near-black background was invisible. Also centralises button variants (primary/secondary/warning/destructive) and nav styles; removes duplicate inline Tailwind from components.PageHeadingComponent.razor— new shared heading component; registered via_Imports.razor.Index,Create,Edit,ManageRoles,Profile,MainLayout,NavMenu— adoptPageHeadingComponent, centralised CSS classes, and tab-indented formatting.Review Arbitration
Legolas flagged two blockers (dark-mode heading and paragraph colours). Gimli confirmed the full test gate was green. Both findings are correct and compatible — bUnit tests verify rendered class names, not computed colour values; visual regressions pass automated tests. The CSS bugs are confirmed regressions (diff shows reversion from correct
dark:text-primary-200to brokendark:text-primary-950). Fixed by Aragorn before push.Test Gate
Closes #291
Closes #292