← Về thư mục
📄 / / root / GitHub / Projects / nhi-nhi-vo-blog / DESIGN.md

Design System Specification (nhivo.io.vn)

This document outlines the visual design system, token configuration, and component styling patterns used across the platform. It is designed to be reusable and applicable to sister sites (such as the Vietnam Wedding Guide blog) to ensure consistent, premium editorial presentation.


1. Core Visual Philosophy


2. Design Tokens & Variables

Color Palette (Tailwind Tokens)

The palette mimics natural materials (paper, ink, terracotta) and uses custom HSL variables to support a cohesive theme switch between light and dark modes.

Variable Name Utility Class Light Hex / Fallback Dark Hex / Fallback Usage
paper bg-paper #F4F1E2 (Dynamic inverted) Primary background canvas
paper-alt bg-paper-alt #EAE6D6 (Dynamic inverted) Card backgrounds, alternative rows
ink text-ink #513229 #e2e8f0 (slate) Primary body copy, headers
ink-secondary text-ink-secondary #786059 #94a3b8 Supporting text, metadata
terracotta text-terracotta #C98E73 #C98E73 Accent highlights, buttons
border-light border-border-light #DDDABF #475569 Subtle line dividers, borders

For dynamic primary and highlight colors, configure tailwind variables mapping to rgb(var(--color-primary-50) / <alpha-value>) etc. in tailwind.config.mjs.


3. Typography & Hierarchy

Typography defines the grid and reading order. Default browser styles are bypassed entirely.

Font Families

Sizing and Spacing


4. Layout & Grid System

Width Constraints

Different viewport configurations dictate content density depending on the page type:


5. UI Primitives & Components (Radix UI)

Headless components from Radix UI provide interactive behavior, styled cleanly with Tailwind utility classes.

Accessibility State Design

Interactive elements must explicitly handle the following tailwind-state combinations: - Focus: focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-terracotta - Active / Select: data-[state=open]:bg-paper-alt (for dropdown menus/popovers) or selection background highlights. - Hover: Subtle opacity transitions (transition-opacity hover:opacity-80 or color shifting).

Reusable Primitives Structure

  1. Dropdown Menus / Selects:
  2. Renders in Portal wrapper to avoid parent overflow: hidden constraints.
  3. Styled drop-shadow container (shadow-lg).
  4. Modals (Dialogs):
  5. Fixed, centered content (left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2).
  6. Semi-transparent dark overlay backdrop (bg-black/50 backdrop-blur-sm).
  7. Keyboard trapping is preserved.

6. Motion & Animation System

The motion system is calibrated to feel invisible and slow. Avoid springy, high-frequency, or bounce transitions.

Predefined Keyframes (tailwind.config.mjs tokens):


7. Custom CSS Implementations

For custom features or overrides (such as KaTeX formatting or custom scrollbar overrides), stick to utility-aligned classes in global.css:

/* Custom utility override pattern */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}