Skip to content

fix(aicoc-hub): dark mode for session-card on /aicochub#101

Open
dosteinacher wants to merge 4 commits into
mainfrom
fix/dark-mode-session-card
Open

fix(aicoc-hub): dark mode for session-card on /aicochub#101
dosteinacher wants to merge 4 commits into
mainfrom
fix/dark-mode-session-card

Conversation

@dosteinacher

Copy link
Copy Markdown
Collaborator

Summary

PR #98 only dark-moded .article-card (blog list). The AI CoC hub's .session-card has its own block CSS and was untouched, so on /en/aicochub with the OS in dark mode the cards still rendered with a bright white body sitting on a near-black page — and the title/description inside inherited the now-light --body-color, making text hard to read.

This PR adds a dark-mode block to blocks/session-card/session-card.css:

  • Card body → #1a1a1c (matches the page tone)
  • Border → #2a2a2e
  • Title → #f0f0f0, description → #c5c5c9, presenter → #f0f0f0
  • Hover shadow opacity bumped from 12% red to 60% black so the lift still reads on dark

Light mode is byte-identical — change is fully inside @media (prefers-color-scheme: dark).

Preview

Branch preview host: fix-dark-mode-session-card--inside-aem--adobe.aem.page

Note on the empty card bodies

The two sessions currently visible on the hub (Unlocking AI Productivity with EasyMCP Desktop, Learning Machine) appear to have empty white bodies in the screenshot. That's a separate issue from dark mode — likely because those two docs were published without description or presenter in their Metadata table, so the card has nothing to render below the title. After this PR lands and the patched docs in ~/Downloads/aicocdocs/ get uploaded, the bodies should populate.

Test plan

  • /en/aicochub in OS dark mode → cards have dark bodies, all text readable
  • /en/aicochub in OS light mode → identical to production
  • Hover still feels right in dark mode (shadow now visible)

🤖 Generated with Claude Code

PR #98 only dark-moded the .article-card (blog list cards). The AI CoC
hub's session-card has its own styling and was untouched — so on
/aicochub with the OS in dark mode, cards still rendered with a bright
white body sitting on a near-black page. Visually jarring; text inside
the white body inherited the now-light dark-mode body color, making the
title and description hard to read.

Mirror the article-card approach: in @media (prefers-color-scheme: dark),
darken the card body to #1a1a1c, flip text colors to light grays, and
bump the hover shadow so the lift still reads on dark.

Light mode is byte-identical — change is fully scoped to the media query.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Jun 9, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@aem-code-sync

aem-code-sync Bot commented Jun 9, 2026

Copy link
Copy Markdown
Page Scores Audits
📱 /en/aicochub PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS
🖥️ /en/aicochub PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS

Two follow-ups on top of the dark-mode card colors:

1. **Empty media void**: When a session has no cover image (which is all
   of them today), the 16:9 `.session-card-media` placeholder shows a
   dark gradient. That gave visual separation in light mode but in dark
   mode it merges with the now-dark card body — leaving a tall void
   above the title with just the AI COC pill floating in it.

   Fix: in dark mode + no-image, collapse the media area to a 48px strip
   (just room for the pill), hide the placeholder gradient div, and hide
   the play overlay (no thumbnail to "play" anyway).

2. **Raw Excel-serial dates**: The publishing pipeline serialises Word
   doc date cells as Excel serial numbers ("46175"). session-feed.js
   already converts these for sorting, but the value passed to the card
   was the raw string — so cards rendered "46175 · Neeraj Garg" instead
   of "Jun 4, 2026 · Neeraj Garg".

   Fix: add `formatSessionDate()` to session-card.js (mirrors the one in
   session-header.js) and call it before render.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@aem-code-sync aem-code-sync Bot temporarily deployed to fix/dark-mode-session-card June 9, 2026 13:26 Inactive
Two further follow-ups after the dark-mode color fix:

1. **Contain the hub hero.** `body.aicoc-hub main > div:first-of-type`
   was full-bleed, so in light mode the dark gradient extended edge-to-
   edge and the page looked entirely dark. Give it a `max-width: 1200px`,
   center it with auto margins, and round the corners — now the page bg
   shows breathing room on either side and the hero reads as a centered
   block. Same change benefits dark mode too (with a slightly tinted
   body bg so the contained hero still stands out against the page).

2. **Reliably collapse no-image card media.** The previous attempt used
   `.session-card-media:has(.session-card-placeholder)` to collapse the
   empty 16:9 dark-gradient area to a 48px strip in dark mode, but the
   `:has()` rule didn't take effect in practice (still seeing the void).
   Switch to a JS-driven `.session-card--no-image` modifier on the card,
   target it with a plain descendant selector — applies in both light
   and dark mode for consistency, and adds a subtle border between the
   pill strip and the body so the AI COC tag still feels anchored.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@aem-code-sync aem-code-sync Bot temporarily deployed to fix/dark-mode-session-card June 9, 2026 14:04 Inactive
Two visual tweaks based on dark-mode preview feedback:

1. **Lighter cards.** The previous #1a1a1c card bg was too close to the
   page tone — cards barely separated from the background. Bump to
   #2d2d33 with a #3d3d44 border so cards visibly lift. Text colors
   nudged slightly lighter to keep readable contrast (#f5f5f7 title,
   #d4d4d8 description).

2. **Blend the hero corners with the page.** The hero's border-radius
   was revealing the page bg (#0e0e10) at the corners, which read as
   lighter "white" patches next to the hero's #0b0b0d darkest gradient
   stop. Match the page bg to the hero's darkest tone so the rounded
   corners disappear into the page seamlessly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant