Design Technologist · AI-Assisted CSS Engineering

Asymmetric dashboard hierarchy, engineered with explicit CSS Grid areas.

This showcase documents the complete Week 04 assignment from raw semantic dashboard HTML through prompt engineering, explicit-track auditing, responsive area remapping, and a verified Administrative Dashboard Workspace.

01Problem
02CSS Concepts
03Raw HTML
04AI Prompt
05Audit
06Final Result
07Verification
01

Why uniform card grids fail production dashboards

Analytics workspaces need deliberate hierarchy across charts, KPIs, event feeds, and status regions.

Before

A simple auto-flowing card grid treats every widget as visually equal. It cannot guarantee that the chart dominates, the event log remains tall, or compact metrics stay aligned inside differently sized cells.

Modern approach

An explicit four-column Grid defines named rectangular areas for each responsibility. The browser can still create controlled implicit rows when unexpected content appears, while compound alignment keeps small KPI content precisely positioned.

Uniform card treatment Invalid area rectangles Missing row tracks Absolute positioning Uncontrolled overflow
02

The CSS Grid systems behind asymmetric dashboard hierarchy

Six coordinated concepts define placement, sizing, overflow behavior, and alignment.

03

The semantic dashboard before layout engineering

All five widgets are meaningful, but normal document flow has not yet created the intended visual hierarchy.

before.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Week 04 Lab: Dynamic Dashboard Grid</title>
</head>
<body>

  <div class="dashboard-shell">
    <header class="dashboard-header">
      <h1 class="dashboard-title">System Metrics Console</h1>
      <p class="dashboard-subtitle">Real-time infrastructure analytics and monitoring.</p>
    </header>

    <!-- The Master Dashboard Grid -->
    <main class="dashboard-grid">
      
      <!-- Card 1: Main Graph (Spans multiple columns/rows) -->
      <section class="dash-card card-chart">
        <div class="dash-card__header">
          <h3>Network Throughput</h3>
          <span class="status-indicator">Live</span>
        </div>
        <div class="dash-card__content placeholder-chart">
          <!-- Visually represents a large chart workspace -->
          <div class="bar-chart-mock"></div>
        </div>
      </section>

      <!-- Card 2: Quick Stat A (Small, compact metrics box) -->
      <section class="dash-card card-stat-a">
        <span class="stat-label">Active Connections</span>
        <span class="stat-number">4,821</span>
        <span class="stat-trend trend--up">+12% vs last hour</span>
      </section>

      <!-- Card 3: Quick Stat B (Small, compact metrics box) -->
      <section class="dash-card card-stat-b">
        <span class="stat-label">Error Rate</span>
        <span class="stat-number">0.04%</span>
        <span class="stat-trend trend--down">-2.1% vs last hour</span>
      </section>

      <!-- Card 4: Detailed Activity Feed (Tall, vertical list panel) -->
      <section class="dash-card card-feed">
        <div class="dash-card__header">
          <h3>Recent Events Log</h3>
        </div>
        <ul class="activity-list">
          <li><strong>12:14:10</strong> - DB Backup completed successfully</li>
          <li><strong>12:11:03</strong> - API endpoint latency alert resolved</li>
          <li><strong>12:05:45</strong> - SSL certificate renewed automatically</li>
          <li><strong>12:00:01</strong> - Automated cron task executed</li>
        </ul>
      </section>

      <!-- Card 5: Infrastructure Status (Wide block) -->
      <section class="dash-card card-status">
        <div class="dash-card__header">
          <h3>Cluster Distribution</h3>
        </div>
        <div class="status-pills">
          <span class="pill pill--online">US-East (Online)</span>
          <span class="pill pill--online">EU-Central (Online)</span>
          <span class="pill pill--degraded">AP-South (Degraded)</span>
        </div>
      </section>

    </main>
  </div>

</body>
</html>

Browser defaults only

System Metrics Console

Real-time infrastructure analytics and monitoring.

Network Throughput

Live chart workspace

Active Connections

4,821

+12% vs last hour

Error Rate

0.04%

-2.1% vs last hour

Recent Events Log

  • DB Backup completed successfully
  • API endpoint latency alert resolved

Cluster Distribution

US-East · EU-Central · AP-South

04

How the AI prompt became an auditable Grid contract

Each layer converts the assignment into a requirement that can be inspected in source and computed layout behavior.

Layer 1 — Lock the structure

Preserve the supplied semantic widgets and structural class names.

Layer 2 — Define explicit tracks

Require four desktop columns, three row tracks, and one rectangular named-area map.

Layer 3 — Assign area ownership

Map every card to its named region and reserve the chart, feed, status, and KPI hierarchy.

Layer 4 — Control overflow tracks

Size implicit rows deliberately and keep long content shrink-safe.

Layer 5 — Align and remap

Apply compound KPI alignment and responsive two- and one-column area maps.

Layer 6 — Demand verification

Audit rectangles, computed tracks, zoom, keyboard focus, themes, and overflow.

AI prompt
Act as a senior CSS systems engineer. Generate a production-ready stylesheet for the supplied Administrative Dashboard Workspace HTML without replacing its semantic structure or structural class names.

Architecture requirements:

1. Apply a predictable border-box reset and define a concise set of custom properties for dashboard colors, spacing, borders, radii, shadows, and track sizing.

2. Style .dashboard-grid with display: grid and define an explicit four-column desktop grid using grid-template-columns. Define three explicit row tracks with grid-template-rows rather than relying only on browser-generated rows.

3. Use this exact desktop grid-template-areas map: "chart chart stat-a feed" "chart chart stat-b feed" "status status status feed". Every row must contain four cells, and every repeated named area must form one rectangle.

4. Assign .card-chart, .card-stat-a, .card-stat-b, .card-feed, and .card-status to the corresponding named areas with grid-area. Do not use absolute positioning, floats, CSS tables, or fixed positional offsets for the dashboard layout.

5. Define grid-auto-rows with a content-safe minmax() value so any item that overflows the explicit template creates a deliberate implicit row instead of an uncontrolled browser-default track.

6. Use a parent-controlled gap system based on relative spacing tokens. Keep every grid child shrink-safe with min-inline-size: 0 and allow long event text to wrap without causing horizontal page overflow.

7. Center the content of .card-stat-a and .card-stat-b vertically with align-content: center while keeping their text aligned to the inline start with justify-items: start. Use align-items or justify-content only where each nested component actually requires them.

8. Make the chart card span the large left region, the feed occupy the full right-side vertical region, and the status card stretch across the three lower left columns exactly as named in the area template.

9. Create responsive two-column and one-column grid-template-areas maps at narrower widths. Preserve source order, readable content, keyboard access, and a layout that remains usable at 200% zoom and near 320px.

10. Style the supplied dashboard cards, chart placeholder, status indicator, event list, metric trends, and cluster pills without adding JavaScript, external libraries, or extra HTML requirements.

11. Add concise comments explaining the explicit grid, named-area rectangle, implicit-row safety rule, compound metric alignment, and responsive area remapping.

12. Keep the output scoped to the supplied dashboard class system and ensure the stylesheet does not leak into unrelated portfolio components.

Return only the complete CSS stylesheet.
05

Auditing the generated explicit Grid system

The layout is accepted only after track definitions, area rectangles, implicit behavior, and alignment are inspected.

audited CSS excerpt
.dashboard-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(0, 1.35fr)
    minmax(12rem, 0.75fr)
    minmax(14rem, 1fr);
  grid-template-rows:
    minmax(10rem, 1fr)
    minmax(10rem, 1fr)
    minmax(8rem, auto);
  grid-template-areas:
    "chart chart stat-a feed"
    "chart chart stat-b feed"
    "status status status feed";
  grid-auto-rows: minmax(8rem, auto);
  gap: var(--dashboard-space-md);
}

.card-chart { grid-area: chart; }
.card-stat-a { grid-area: stat-a; }
.card-stat-b { grid-area: stat-b; }
.card-feed { grid-area: feed; }
.card-status { grid-area: status; }

.card-stat-a,
.card-stat-b {
  display: grid;
  align-content: center;
  justify-items: start;
  min-inline-size: 0;
}

@media (max-width: 62rem) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(18rem, auto) minmax(10rem, auto) auto auto;
    grid-template-areas:
      "chart chart"
      "stat-a stat-b"
      "status status"
      "feed feed";
  }
}
rectangle correction
/* Invalid: chart cells do not form one rectangle */
grid-template-areas:
  "chart chart stat-a feed"
  "chart stat-b stat-b feed";

/* Valid: every repeated name forms a rectangle */
grid-template-areas:
  "chart chart stat-a feed"
  "chart chart stat-b feed"
  "status status status feed";
Verified: explicit columns

Four desktop column tracks are declared with shrink-safe minmax() sizing.

Verified: explicit rows

Three primary row tracks are declared instead of relying only on automatic generation.

Verified: valid rectangles

Every row has four cells and each repeated area name forms one contiguous rectangle.

Verified: named ownership

Each widget maps to one documented grid-area responsibility.

Corrected: implicit-row sizing

grid-auto-rows protects unexpected content with a deliberate minimum and flexible maximum.

Corrected: no positional hacks

The layout contains no float, absolute placement, fixed offset, or CSS-table dependency.

Verified: compound alignment

KPI content is centered on the block axis and aligned to the inline start.

Verified: responsive remapping

Two-column and one-column maps preserve source order without horizontal page overflow.

06

The final Administrative Dashboard Workspace

Resize or zoom the page: the named regions remap while the chart remains dominant, KPIs stay aligned, and the event feed remains readable.

Infrastructure Operations

System Metrics Console

Real-time infrastructure analytics and monitoring.

Network Throughput

Live
Active Connections4,821+12% vs last hour
Error Rate0.04%-2.1% vs last hour

Recent Events Log

4 events
  • 12:14:10DB Backup completed successfully
  • 12:11:03API endpoint latency alert resolved
  • 12:05:45SSL certificate renewed automatically
  • 12:00:01Automated cron task executed

Cluster Distribution

2 healthy · 1 degraded
US-East (Online)EU-Central (Online)AP-South (Degraded)

Explicit hierarchy

Four columns, three rows, and five named areas make the intended dashboard composition visible in the stylesheet.

Controlled overflow

Implicit rows use minmax(), while long event text and card contents remain shrink-safe.

Responsive area maps

The same semantic source order becomes a two-column workspace and then a single-column reading flow.

07

Technical verification before deployment

The dashboard is accepted only after source, computed Grid behavior, responsiveness, accessibility, and theme coverage are checked.

  1. Inspect .dashboard-grid and confirm its computed display value is grid.
  2. Confirm the desktop layout exposes four explicit column tracks and three explicit row tracks.
  3. Verify every grid-template-areas row has four cells and every repeated name forms a rectangle.
  4. Confirm the chart spans the upper-left two columns and two rows.
  5. Confirm the event feed spans all three rows on the right side.
  6. Confirm the status card spans the lower three columns.
  7. Inspect every widget and verify its computed grid-area matches the declared map.
  8. Temporarily add an auto-placed test item and verify the implicit row follows grid-auto-rows: minmax(8rem, auto).
  9. Confirm both metric cards use align-content: center and justify-items: start.
  10. Search the dashboard rules for forbidden floats, CSS tables, absolute layout placement, and fixed positional offsets.
  11. Resize through desktop, tablet, mobile, and near 320px; confirm the area maps change without page-level horizontal overflow.
  12. Zoom to 200% and confirm the metrics, event feed, pills, and chart region remain readable.
  13. Navigate all portfolio and MDN links with the keyboard and verify visible focus treatment.
  14. Switch Standard, Playful Pop, and Raggedy Granite through dark and light modes and confirm both the showcase shell and dashboard demo change.

AI drafted the Grid strategy. Human auditing verified track ownership, rectangle validity, overflow safety, alignment, responsiveness, and portfolio integration.