---
name: slidev-styling
description: Style Slidev slides with UnoCSS and custom CSS. Use this skill for custom colors, typography, animations, and responsive designs.
---
# Styling in Slidev
This skill covers all styling options in Slidev, including UnoCSS utilities, custom CSS, scoped styles, and advanced styling techniques.
## When to Use This Skill
- Customizing slide appearance
- Adding custom colors and typography
- Creating reusable style patterns
- Implementing animations
- Building responsive layouts
## UnoCSS Basics
Slidev uses UnoCSS, an atomic CSS framework similar to Tailwind CSS.
### Inline Classes
```markdown
Styled text
```
### Common Utilities
**Typography**:
```markdown
SmallBaseLargeExtra Large2XLBoldSemiboldItalicUnderlined
```
**Colors**:
```markdown
Red textBlue textGreen backgroundYellow combo
```
**Spacing**:
```markdown
Padding 4
Margin 2
Horizontal/Vertical padding
Margin top 8
```
**Layout**:
```markdown
LeftRight
Column 1
Column 2
```
## Color System
### Default Colors
```markdown
100500900RedOrangeYellowGreenBluePurplePink
```
### Custom Colors
In `uno.config.ts`:
```typescript
import { defineConfig } from 'unocss'
export default defineConfig({
theme: {
colors: {
brand: {
DEFAULT: '#5d8392',
light: '#8bb4c4',
dark: '#3d5a65',
},
accent: '#f59e0b',
},
},
})
```
Usage:
```markdown
Brand colorLight brand backgroundAccent color
```
## Typography
### Font Sizes
```markdown
```
### Badge
```markdown
Active
```
### Alert Box
```markdown
Warning message
```
### Code Annotation
```markdown
```js
const x = 1 // [!code highlight]
```
Important line!
```
## Best Practices
### 1. Use Utilities First
```markdown
Good
```
### 2. Create Shortcuts for Repeated Patterns
```typescript
shortcuts: {
'btn-primary': 'px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600',
}
```
### 3. Maintain Consistency
Use the same spacing scale:
- `gap-4` everywhere, not mixing `gap-3` and `gap-5`
### 4. Support Dark Mode
Always provide dark mode variants for custom styles.
### 5. Test Export
Some CSS features don't export well to PDF:
- Complex gradients
- Some filters
- Animations (become static)
## Output Format
When styling slides:
```markdown
# [Slide Title]