frontend-design-fix-svelte
关于
This skill automatically upgrades generic Svelte component designs by applying aesthetic improvements across five key dimensions: typography, color, motion, spatial composition, and backgrounds. It analyzes existing components, identifies design anti-patterns, and systematically transforms them into more visually distinctive interfaces. Use this when you need to quickly enhance the visual appeal of bland Svelte components within your project.
技能文档
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
- Read existing Svelte component files (.svelte)
- Identify generic elements (Inter/Roboto fonts, purple gradients, centered layouts, no animations, solid backgrounds)
- Score current design against anti-patterns checklist
- Generate "before" snapshot with metrics
2. Assessment Phase
- Understand brand/context from existing content and component props
- Identify target audience and purpose
- Determine appropriate aesthetic direction based on component usage
3. Dimension-Based Fixes
Typography
- Replace generic system fonts (Inter, Roboto, Arial) with distinctive typeface pairs
- Apply extreme weight ranges (100-200 for thin, 800-900 for bold)
- Increase size jumps (3x+ progression instead of 1.5x)
- Create high-contrast pairings (Display + Mono, Serif + Sans)
- Use scoped styles with Svelte's native CSS-in-component
Color & Theme
- Remove default purple gradients on white backgrounds
- Introduce CSS custom properties for theming
- Establish dominant colors with sharp accent colors
- Avoid evenly-distributed palettes (use 70-20-10 rule)
- Create theme variants (light/dark) with consistent color tokens
Motion
- Add orchestrated page load animations (fade, scale, slide)
- Implement staggered reveals with Svelte transitions and animations
- Add hover state surprises and micro-interactions
- Include scroll-triggered animations via
svelte-use - Use
svelte/animatefor list transitions
Spatial Composition
- Break centered, predictable layouts
- Add asymmetry or intentional overlap
- Introduce diagonal flow or grid-breaking elements
- Adjust spacing (generous negative space OR controlled density)
- Use CSS Grid and Flexbox creatively with Svelte slots
Backgrounds
- Replace solid colors with layered gradients
- Add geometric patterns or subtle noise textures
- Create atmospheric depth with multiple background layers
- Add contextual effects (blur, blend modes)
- Use pseudo-elements for background layering
4. Implementation
- Apply fixes systematically per dimension
- Update component templates and styles
- Maintain accessibility standards (WCAG 2.1 AA)
- Preserve all existing functionality and component props
- Test with responsive design
5. Validation
- Re-score against anti-patterns checklist
- Generate "after" snapshot with improved metrics
- Create before/after comparison report
- Verify accessibility compliance with Vitest
Design Audit Checklist
Typography Audit
- Current font stack is generic (Inter, Roboto, Arial, system stack)
- Font weights are limited (only regular and bold)
- Size progression is minimal (1.25-1.5x multiplier)
- No distinctive pairing strategy
- Poor readability on colored backgrounds
- No responsive typography scaling
Color & Theme Audit
- Purple/blue gradient on white background (cliché)
- No CSS custom properties for theming
- Evenly distributed color palette (5+ primary colors)
- No accent color for emphasis
- Insufficient contrast in interactive elements
- No dark mode support
Motion Audit
- No page load animations or transition directives
- No staggered reveals for lists
- Hover states missing or uninspired
- No scroll interactions
- Abrupt transitions between states
- Missing micro-interactions on buttons/forms
Spatial Composition Audit
- Centered, symmetrical layouts throughout
- Predictable margins and padding
- No intentional asymmetry in component layouts
- Grid-aligned everything (no breaking)
- Single-column or evenly-spaced multi-column layouts
Background Audit
- Solid white or light gray backgrounds
- No layering or depth in backgrounds
- No texture or pattern application
- Generic or missing hero sections
- No atmospheric or contextual effects in components
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
- Keep WCAG AA color contrast minimum 4.5:1 for text
- Maintain focus visible outlines in interactive elements
- Use semantic HTML in Svelte templates
- Test with Vitest and accessibility libraries
- Preserve ARIA attributes
Examples
See /examples/showcase.md for before/after comparisons:
- Generic landing page → Distinctive landing page
- Boring dashboard → Visually striking dashboard
- Plain form → Aesthetically enhanced form
Success Metrics
After applying fixes, the design should:
- Score 0-2 items remaining on the anti-patterns checklist
- Have distinctive typography choices in components
- Include motion and micro-interactions with Svelte transitions
- Feature asymmetric or broken-grid layouts
- Use layered/textured backgrounds via pseudo-elements or gradients
- Maintain or improve accessibility scores
- Support light/dark theme variants
快速安装
/plugin add https://github.com/matteocervelli/llms/tree/main/frontend-design-fix-svelte在 Claude Code 中复制并粘贴此命令以安装该技能
GitHub 仓库
相关推荐技能
langchain
元LangChain是一个用于构建LLM应用程序的框架,支持智能体、链和RAG应用开发。它提供多模型提供商支持、500+工具集成、记忆管理和向量检索等核心功能。开发者可用它快速构建聊天机器人、问答系统和自主代理,适用于从原型验证到生产部署的全流程。
project-structure
元这个Skill为开发者提供全面的项目目录结构设计指南和最佳实践。它涵盖了多种项目类型包括monorepo、前后端框架、库和扩展的标准组织结构。帮助团队创建可扩展、易维护的代码架构,特别适用于新项目设计、遗留项目迁移和团队规范制定。
issue-documentation
元该Skill为开发者提供标准化的issue文档模板和指南,适用于创建bug报告、GitHub/Linear/Jira问题等场景。它能系统化地记录问题状况、复现步骤、根本原因、解决方案和影响范围,确保团队沟通清晰高效。通过实施主流问题跟踪系统的最佳实践,帮助开发者生成结构完整的故障排除文档和事件报告。
llamaindex
元LlamaIndex是一个专门构建RAG应用的开发框架,提供300多种数据连接器用于文档摄取、索引和查询。它具备向量索引、查询引擎和智能代理等核心功能,支持构建文档问答、知识检索和聊天机器人等数据密集型应用。开发者可用它快速搭建连接私有数据与LLM的RAG管道。
