← BackROYAL ANKIT AHIRAN
Skill 05 · CSS

Colors, Themes & Motion

Styling this entire portfolio with consistent color variables, instant Dark/Light theme switching, GPU-friendly hover animations, and adaptive mobile grids.

DEMO

What Was Built

A unified CSS variable design system (`--black`, `--panel`, `--line`, `--white`, `--red`) powering both Dark and Light modes seamlessly, along with responsive breakpoints down to 360px screens.

How It Looked

Clean obsidian surfaces paired with crisp red focal borders (`#E10600`), subtle elevation lift on hover, and balanced typography that switches cleanly to bright daylight surfaces when toggled.

What Was Learned

  • Centralizing colors with `:root` and `body.light-theme` custom properties so themes flip in one class toggle.
  • Keeping transitions strictly on `transform` and `border-color` to avoid layout jitter and preserve 60fps scrolling.
  • Using CSS Grid (`auto-fit` / `minmax`) and targeted media queries for clean mobile card alignment.

Step-by-Step How to Run

  1. Define shared `:root` color tokens and `body.light-theme` overrides inside your stylesheet.
  2. Apply the hover transform rule below to any `.skill-card` or interactive button container.
  3. Preview at mobile (360px) and desktop widths while toggling Dark and Light themes.
style.css — Hover Animation Example
.skill-card {
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.skill-card:hover {
  border-color: var(--red);
  transform: translateY(-5px);
}

Proof

Sample OutputComputed Tokens
Theme: Dark  -> --black: #0A0A0A | --panel: #141414
Theme: Light -> --black: #F5F5F5 | --panel: #FFFFFF
Accent: --red: #E10600 (Focal CTA & Hover Ring)
Hover Transform: translateY(-5px) [GPU Composited]
Interface Capture Slot
◆ DUAL-THEME SYSTEM
Smooth card elevation and crisp contrast verified in both Dark and Light theme states.
Visual token & hover state verification card.