Frontend design html

From matteocervelli/llms · View interactive version

Frontend design html is an AI agent skill from the GitHub repository matteocervelli/llms. Create distinctive, production-grade HTML/CSS frontends with exceptional design quality

How to use this skill

Skill file

Frontend Design HTML Skill

Create distinctive, production-grade HTML/CSS + vanilla JavaScript interfaces with high design quality. This skill combines the 5-dimension aesthetic framework with semantic HTML5, modern CSS, and CSS-only animations to build interfaces that are both beautiful and accessible.


Base Aesthetics Framework

Overview

This is the core 5-dimension framework for creating intentional, non-generic design that avoids the homogenized aesthetic of default AI outputs. Each dimension works together to create designs with personality and deliberation.

The Five Dimensions

1. Typography Dimension

Purpose: Typography is the primary carrier of voice and personality in digital design.

Core Principles:

Implementation:

Example Pattern:

2. Color & Theme Dimension

Purpose: Color sets mood and creates visual coherence while avoiding cliché palettes.

Core Principles:

Anti-Patterns to Avoid:

Implementation:

Example Approach:

3. Motion Dimension

Purpose: Motion reveals personality and guides user attention with intentionality.

Core Principles:

Implementation for HTML/CSS:

Anti-Patterns:

4. Spatial Composition Dimension

Purpose: Space and layout create rhythm and guide the eye through intentional composition.

Core Principles:

Implementation:

Anti-Patterns:

5. Backgrounds & Visual Details Dimension

Purpose: The foundation layer that can transform a generic design into something memorable.

Core Principles:

Implementation:

Anti-Patterns:

Anti-Generic-AI Guardrails

Use these checks to ensure your design doesn't default to generic AI output:

Typography Check:

Color Check:

Motion Check:

Spatial Check:

Background Check:


Typography Guidance

Typefaces to Avoid

These fonts are ubiquitous in default AI outputs and should be rejected as your primary choice:

If you use any of these, pair them with something unexpected and deliberately break the generic pattern.

Typefaces to Prefer

These faces bring personality and intention to design:

Display & Decorative
Body & Copy
Monospace (Technical, Quotes, Code)

Pairing Strategy

High-Contrast Pairings (Recommended)

Pattern 1: Display + Mono

Headline: Playfair Display (elegant serif)
Body: JetBrains Mono (technical monospace)
Result: Sophisticated + Modern

Pattern 2: Serif + Geometric Sans

Headline: Crimson Pro (high-contrast serif)
Body: Space Grotesk (geometric sans)
Result: Elegant + Contemporary

Pattern 3: Decorative + Humanist

Headline: Bricolage Grotesque (handcrafted sans)
Body: IBM Plex Sans (warm humanist sans)
Result: Crafted + Approachable

Avoid Sameness

Don't use two similar typefaces:

Font Weights & Extremes

Weight Strategy

Use weight extremes to create contrast, not mid-range weights:

Good:

Avoid:

Size Jumps: Extreme Over Incremental

Size Scale Strategy

Use 3x+ jumps between hierarchy levels, not incremental 1.5x steps:

Generic (Linear Scaling):

H1: 48px
H2: 36px (75% of H1)
H3: 28px (78% of H2)
Body: 16px
Small: 14px

Result: Feels predictable, every size feels similar distance apart.

Intentional (3x+ Jumps):

Display: 96px (3x body)
Headline: 48px (3x body)
Sub-headline: 28px (1.75x body)
Body: 16px
Caption: 12px (0.75x body)

Result: Creates clear visual hierarchy, extreme sizes make smaller sizes feel intentional.

Implementation Rules
  1. Start with body size (16px or 18px is standard)
  2. Create display size as 4-6x body (64px-96px)
  3. Create headline as 2-3x body (32px-48px)
  4. All other sizes fall between these extremes
  5. Use odd numbers when possible (not round 10px increments)

Example: 16px Base

Line Height & Letter Spacing

Line Height Strategy
Letter Spacing Strategy

CSS Font Stack Example

/* Display */
.display {
  font-family: 'Playfair Display', serif;
  font-size: 88px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* Headline */
.h1 {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.25px;
}

/* Body */
.body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
}

/* Monospace (Code/Quotes) */
.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

/* Small Text */
.caption {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0px;
}

Font Loading (Google Fonts)

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=IBM+Plex+Sans:wght@400;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">

Typography Checklist


Motion & Animation Guidance

Overview

Motion reveals personality and guides user attention with intentionality. Deliberate animation transforms passive interfaces into experiences that feel alive and considered.

Core Principles

  1. Orchestration: Animations should feel planned, not random
  2. Purpose: Every animation should serve a functional or emotional purpose
  3. Timing: Easing functions matter more than duration
  4. Context: Page loads, scrolls, and hovers each have different animation strategies

CSS Animations

Use CSS for simple, performant animations that run on page load or interaction:

Basic Fade-In
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.element {
  animation: fadeIn 0.6s ease-out;
}
Slide + Fade In
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.element {
  animation: slideInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
Scale + Fade In
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.element {
  animation: scaleIn 0.5s ease-out;
}

Page Load Animation Strategy

Orchestrated Reveal

Don't animate everything at once. Create a sequence that guides the user's eye:

Timing Sequence

0ms    - Background/Hero fades in
200ms  - Headline slides in from top
400ms  - Sub-headline fades in
600ms  - Primary CTA appears
800ms  - Supporting content staggered reveal

CSS Implementation

.hero {
  animation: fadeIn 0.8s ease-out 0ms;
}

.headline {
  animation: slideInDown 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 200ms backwards;
}

.subheadline {
  animation: fadeIn 0.6s ease-out 400ms backwards;
}

.cta {
  animation: scaleIn 0.5s ease-out 600ms backwards;
}

.content-item {
  animation: slideInUp 0.8s ease-out backwards;
}

.content-item:nth-child(1) { animation-delay: 800ms; }
.content-item:nth-child(2) { animation-delay: 900ms; }
.content-item:nth-child(3) { animation-delay: 1000ms; }

Staggered Reveals

Using animation-delay (CSS)

Stagger elements to create a cascade effect:

.list-item {
  opacity: 0;
  animation: slideInUp 0.8s ease-out forwards;
}

.list-item:nth-child(1) { animation-delay: 0ms; }
.list-item:nth-child(2) { animation-delay: 100ms; }
.list-item:nth-child(3) { animation-delay: 200ms; }
.list-item:nth-child(4) { animation-delay: 300ms; }
.list-item:nth-child(5) { animation-delay: 400ms; }

Scroll Trigger Animations

Intersection Observer (Vanilla JS)
const observer = new IntersectionObserver((entries) => {
  entries.forEach((entry) => {
    if (entry.isIntersecting) {
      entry.target.classList.add('animate-in');
      observer.unobserve(entry.target);
    }
  });
});

document.querySelectorAll('[data-animate]').forEach((el) => {
  observer.observe(el);
});
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease-out;
}

[data-animate].animate-in {
  opacity: 1;
  transform: translateY(0);
}

Hover State Surprises

Hover interactions should be delightful, not just functional:

CSS Hover Animations
.card {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

/* Icon rotation on hover */
.icon {
  transition: transform 0.3s ease-out;
}

.card:hover .icon {
  transform: rotate(45deg) scale(1.1);
}

/* Text color shift */
.link {
  color: #333;
  transition: color 0.3s ease-out;
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease-out;
}

.link:hover {
  color: #0099ff;
  border-bottom-color: #0099ff;
}

Easing Functions

Recommended Easing Values

Anti-Patterns to Avoid


Design Thinking: Pre-Coding Workflow

Overview

Before writing code or generating design, establish the intentional foundation. This workflow prevents default thinking and ensures your design serves a purpose beyond aesthetic choice.

The Pre-Design Checklist

Don't design until you answer these four questions:

  1. Purpose: What problem are we solving? Who are we solving it for?
  2. Tone: What emotional response do we want? What aesthetic direction reflects this?
  3. Constraints: What are the real technical, temporal, or business limits?
  4. Differentiation: What one unforgettable element makes this distinctly ours?

1. Purpose: Problem & Users

Understand the Problem

Before choosing any visual element, define what you're solving:

Questions to Answer:

User Context Worksheet
Primary User:
- Age & background: ___________
- Technical skill level: ___________
- Primary use context: (work, leisure, research, etc.)
- How much time will they spend here? ___________
- What's their emotional state on arrival? ___________

Problem They're Solving:
- Specific challenge: ___________
- Current workaround (how do they solve it now?): ___________
- Desired outcome: ___________
- What's the cost of not solving it? ___________

Success Metrics:
- How will we know if this design works? ___________
- What behavior change indicates success? ___________

2. Tone: Aesthetic Direction

Define Emotional Intent

Based on your purpose, what emotional response should the design evoke?

Emotional Directions:

Tone Definition Worksheet
Emotional Intent:
- Primary emotion we want users to feel: ___________
- Tone adjectives (3-5): ___________
- What should users think when they see this? ___________
- What should they feel when they interact? ___________

Design Personality:
- Is this design "serious" or "playful"?
- Is it "minimal" or "expressive"?
- Is it "traditional" or "unconventional"?
- Is it "warm" or "cool"?

Visual Direction:
- Color personality: (warm, cool, saturated, muted)
- Typography style: (traditional, modern, handcrafted, geometric)
- Motion style: (snappy, smooth, playful, none)
- Overall style: (minimalist, maximalist, balanced)

3. Constraints: Reality Check

Define Technical, Business, and Creative Limits

Before designing, know your boundaries:

Categories:

Constraints Worksheet
Technical Constraints:
- Required browser support: ___________
- Performance budget: (load time, interaction delay)
- Required frameworks/libraries: ___________
- API availability/limitations: ___________
- Device support (mobile first?): ___________

Temporal Constraints:
- Design timeline: ___________
- Development timeline: ___________
- Launch date: ___________
- Available resources: ___________

Business Constraints:
- Brand guidelines to follow: (yes/no, which parts?)
- Compliance requirements: (WCAG, GDPR, etc.)
- Target market expectations: ___________
- Pricing/positioning tier: (premium, budget, etc.)

Creative Freedom:
- How much can we deviate from industry norms?
- Are we required to use specific design patterns?
- Any visual or interaction taboos?

4. Differentiation: The Unforgettable Element

Identify One Distinctive Feature

Every intentional design has one element that makes it memorable and distinctly yours. This isn't about complexity—it's about one deliberate choice that stands out.

Differentiation Framework

Types of Differentiation:

  1. Typography Signature
  1. Color Signature
  1. Motion Signature
  1. Layout/Composition Signature
  1. Micro-interaction Signature
  1. Visual Detail Signature
Differentiation Worksheet
Current State (What do competitors do?):
- Typography: ___________
- Color: ___________
- Motion: ___________
- Layout: ___________
- Interactions: ___________

Our Differentiation (What will we do differently?):
- Chosen category: (Typography, Color, Motion, etc.)
- The specific distinctive choice: ___________
- Why this choice? (How does it serve the purpose & tone?)
- Where will it appear? (Headline, accent, hover state, etc.)
- Is it instantly recognizable as "ours"? (Yes/No)

The Unforgettable Element:
- In one sentence, describe what makes this design distinctly ours:
  ___________

Pre-Design Workflow: The Complete Picture

Before you design, complete this:

1. PROBLEM & USERS ✓
   Problem: ___________
   Primary user: ___________
   Their emotion on arrival: ___________
   Success metric: ___________

2. TONE & AESTHETICS ✓
   Emotional intent: ___________
   Tone adjectives: ___________
   Personality: (Serious/Playful, Minimal/Expressive, etc.)
   Visual direction: ___________

3. CONSTRAINTS ✓
   Technical: ___________
   Temporal: ___________
   Business: ___________
   Creative freedom level: ___________

4. DIFFERENTIATION ✓
   Unforgettable element: ___________
   Why this specific choice: ___________
   Where it appears: ___________

5. READY TO DESIGN ✓
   All four questions answered: (Yes/No)
   Team alignment on direction: (Yes/No)
   Prepared to brief designer/engineer: (Yes/No)

Anti-Patterns: What to Avoid

Typography Anti-Patterns

Avoid:

Result: Immediately reads as "default AI design," no personality.

Color & Theme Anti-Patterns

Avoid:

Identifies as: "I used the default design system"

Layout & Spatial Anti-Patterns

Avoid:

Reads as: "Default SaaS dashboard"

Motion & Animation Anti-Patterns

Avoid:

Background & Visual Details Anti-Patterns

Avoid:


HTML/CSS-Specific Guidance

Semantic HTML5 Elements

Always use semantic elements for structure and accessibility:

<header>
  <!-- Site header, logo, primary navigation -->
</header>

<nav>
  <!-- Navigation links -->
</nav>

<main>
  <!-- Primary page content -->
  <article>
    <!-- Self-contained content -->
    <section>
      <!-- Thematic grouping -->
    </section>
  </article>

  <aside>
    <!-- Tangential content, sidebars -->
  </aside>
</main>

<footer>
  <!-- Site footer, secondary links, metadata -->
</footer>

CSS Grid and Flexbox

Use CSS Grid for complex layouts and Flexbox for component-level organization:

/* Grid for page layout */
body {
  display: grid;
  grid-template-columns: 1fr minmax(0, 64rem) 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

header {
  grid-column: 1 / -1;
}

main {
  grid-column: 2;
}

/* Flexbox for component alignment */
.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

CSS Custom Properties (Variables)

Define color, spacing, and typography in custom properties for easy theming:

:root {
  /* Colors */
  --color-primary: #2d3748;
  --color-accent: #d4a574; /* Warm brown accent */
  --color-background: #f7f5f2; /* Warm cream */
  --color-text: #3d3d3d;

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 0.2s ease-out;
  --transition-base: 0.3s ease-out;
  --transition-slow: 0.6s ease-out;
}

Mobile-First Responsive Design

Start with mobile layout, then enhance for larger screens:

/* Mobile-first (default) */
.container {
  width: 100%;
  padding: var(--space-md);
}

/* Tablet and up */
@media (min-width: 768px) {
  .container {
    max-width: 768px;
    margin: 0 auto;
  }
}

/* Desktop and up */
@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

WCAG 2.1 Level AA Compliance

Build accessibility into your design:

<!-- Use proper heading hierarchy -->
<h1>Page Title</h1>
<h2>Section Heading</h2>
<h3>Subsection</h3>

<!-- Always include alt text -->
<img src="hero.jpg" alt="Descriptive text about the image">

<!-- Use ARIA attributes when needed -->
<button aria-label="Close dialog" aria-pressed="false">
  ✕
</button>

<!-- Ensure color contrast ratios are sufficient -->
<!-- Aim for 4.5:1 for normal text, 3:1 for large text -->
/* Ensure focus indicators are visible */
:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Use sufficient line height for readability -->
body {
  line-height: 1.6;
}

/* Ensure touch targets are at least 44x44px -->
button {
  min-height: 44px;
  min-width: 44px;
}

Implementation Workflow

Before coding, complete the design thinking worksheet:

1. Design Thinking Phase

2. Typography Dimension

3. Color & Theme Dimension

4. Motion Dimension

5. Spatial Composition Dimension

6. Backgrounds & Visual Details Dimension

7. Implementation

8. Validation


Pre-Submit Checklist

Before delivering, verify:


Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.