Frontend design fix svelte

From matteocervelli/llms · View interactive version

Frontend design fix svelte is an AI agent skill from the GitHub repository matteocervelli/llms. Fix generic Svelte component designs by applying aesthetic upgrades across the 5 design dimensions (typography, color, motion, spatial composition, backgrounds)

How to use this skill

Skill file

Frontend Design Fix - Svelte

Overview

Transform bland, generic Svelte component designs into visually distinctive interfaces by systematically applying the 5 design dimensions from Anthropic's design framework.

Core Workflow

1. Analysis Phase

2. Assessment Phase

3. Dimension-Based Fixes

Typography
Color & Theme
Motion
Spatial Composition
Backgrounds

4. Implementation

5. Validation

Design Audit Checklist

Typography Audit

Color & Theme Audit

Motion Audit

Spatial Composition Audit

Background Audit

Implementation Tips

Svelte Component with Scoped Styles

<script>
  import { onMount } from 'svelte';

  let isVisible = false;

  onMount(() => {
    isVisible = true;
  });
</script>

<div class="container" class:visible={isVisible}>
  <h1>Distinctive Title</h1>
  <p>Beautifully designed with Svelte</p>
</div>

<style>
  :root {
    --font-display: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --primary: #1a1a1a;
    --accent: #ff6b35;
    --surface: #fafafa;
  }

  .container {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
  }

  .container.visible {
    opacity: 1;
    transform: translateY(0);
  }

  h1 {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    color: white;
  }

  p {
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.8);
    margin-top: 1rem;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
</style>

Staggered List with Svelte Animate

<script>
  import { flip } from 'svelte/animate';
  import { fade } from 'svelte/transition';

  export let items = [];
</script>

<div class="list-container">
  {#each items as item, i (item.id)}
    <div
      class="list-item"
      animate:flip={{ duration: 200 }}
      transition:fade
      style="--stagger-index: {i}"
    >
      {item.content}
    </div>
  {/each}
</div>

<style>
  .list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .list-item {
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--primary);
    animation: slideIn 0.4s ease-out;
    animation-delay: calc(var(--stagger-index) * 100ms);
  }

  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateX(-20px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
</style>

Theme Store with Svelte

<!-- stores/theme.js -->
import { writable } from 'svelte/store';

export const theme = writable({
  colors: {
    primary: '#1a1a1a',
    accent: '#ff6b35',
    surface: '#fafafa',
    background: '#ffffff',
  },
  fonts: {
    display: "'Playfair Display', serif",
    body: "'Inter', sans-serif",
    mono: "'IBM Plex Mono', monospace",
  },
});

export function toggleDarkMode() {
  theme.update(t => ({
    ...t,
    colors: {
      primary: '#f5f5f5',
      accent: '#ff6b35',
      surface: '#1a1a1a',
      background: '#0a0a0a',
    },
  }));
}
<!-- App.svelte -->
<script>
  import { theme } from './stores/theme.js';
</script>

<div
  style="
    --primary: {$theme.colors.primary};
    --accent: {$theme.colors.accent};
    --surface: {$theme.colors.surface};
    --font-display: {$theme.fonts.display};
    --font-body: {$theme.fonts.body};
  "
>
  <slot />
</div>

<style>
  div {
    color: var(--primary);
    background: var(--surface);
    font-family: var(--font-body);
  }
</style>

Scroll-Triggered Animations

<script>
  import { onViewportEnter } from 'svelte-use';

  let visible = false;
</script>

<div use:onViewportEnter={() => visible = true} class:visible>
  <h2>Appears when scrolled into view</h2>
</div>

<style>
  div {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s ease-out;
  }

  div.visible {
    opacity: 1;
    transform: translateY(0);
  }
</style>

Accessibility Maintenance

Examples

See /examples/showcase.md for before/after comparisons:

Success Metrics

After applying fixes, the design should:

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.