Context
The owner had two complaints. First, content sits in a narrow column with wide empty bands on both sides. Second, the colours look dated.
The width problem comes from every page choosing its own cap. A Bootstrap container sets 1320px on the shell and landing page. Other pages use max-w-5xl, 6xl or 7xl, max-w-[1600px] or max-w-[1120px]. Some do this inside a portal shell that already adds its own padding. At 1920px the landing page left 300px empty on each side. The header, a page title and a card grid could each start at a different x position (65, 105 and 161px on /blog at 1440px).
The colour problem comes from the measured template palette: navy headings (#00305c), a bright Bootstrap blue and Bootstrap greys. Several pieces were also broken:
- the shell hard-coded raw hex, so the header stayed white in dark mode;
- white text on the dark-theme accent was 3.4:1, which fails AA;
text-warningandbg-warning-softwere used in four files but never defined.
The UI review behind this decision is in docs/research/ui-review-2026-11.md.
Decision
- Palette: cool slate neutrals and one cobalt accent. The token names stay the same, so every page picks up the new palette without a code change. Light theme: - headings
ink#0f172a, bodymuted#3f4b5e, meta textsubtle#5f6b7e (now solid, so it stays AA on tinted bands); -accent#3056d3; - status coloursadditional(success) #0a7f57,danger#d92d20 and a newwarning#b45309. Each one has-softand-inkvariants.
Dark theme: the accent becomes #8ba6ff and on-accent flips to the dark page colour, because white on a light accent cannot pass AA. Shadows take the slate hue instead of pure black. Every text pairing is AA, and the ratios are listed in DESIGN-DNA §2.
- New tokens: -
warning,warning-soft,warning-ink; -line-field, an input border at 3:1 or more (WCAG 1.4.11;lineis decorative only); -max-w-page(110rem, about 1760px, gutter included); -max-w-reading(46rem, about 70 characters); -px-gutter(clamp(1rem, 0.4rem + 2.6vw, 3rem): 16px on a phone, about 44px at 1440px, 48px from about 1600px). PageContainerin@smartlearn/uiis the only horizontal frame. It lives next to the other primitives because the web app and any future app share it. -size="page"(default): full width with the gutter, capped only on very wide screens. -size="reading": the same gutter, with the text column held tomax-w-reading(blog articles, long forms). -size="full": no cap, for data-dense screens.
It owns the sides only; vertical rhythm stays with Section. The old Container and the Bootstrap CONTAINER constant are deprecated. CONTAINER is removed from the shell.
- The shell is the reference implementation. The header is sticky on the page surface (theme-aware, hairline at rest,
shadow-headeronce scrolled). It shows inline navigation fromlg, and "Trở thành giảng viên" fromxl. The footer has two variants: a tinted band, or thesurface-oppslab. Header, footer and landing sections share one gutter, so their left edges line up at every width.
Alternatives considered
- Keep a fixed 1280–1440px container and only widen it. This still leaves 240px bands at 1920px and solves nothing below 1440px. The owner asked for content close to the edges.
- No cap at all. At 2560px lines and card rows get too long to scan. 1760px is the widest setting where a four-card row still reads as a group.
- A new hue (teal or violet) instead of cobalt. It would break the brand recognition the team already has, and a violet-blue gradient is the most common "generic AI" look. A calmer cobalt on slate modernises the palette without a rebrand.
- New token names (
primary,fg, …). Rejected: renaming would touch every file in the app for no visual gain. The values change, the names stay.
Consequences
- Every page gets the new colours immediately. Pages that still hard-code hex or stock Tailwind colours (
emerald-600,zinc-200, …) now stand out, and #186 and #187 replace them using the findings document. - Text on a
-softfill must use the matching-inktoken. The solid status colours are only guaranteed AA onsurfaceandsurface-tint. - In dark mode, components that put
text-whiteonbg-accentlose contrast. They must usetext-on-accent.