Preview Components
The application includes several specialized preview components:Cursor Preview
Shows cursor style, color, opacity, and blink animation
Font Preview
Displays terminal text with current font settings
Color Preview
Terminal output showing color scheme and selection
Palette Preview
Grid of all 256 palette colors
Icon Preview
macOS app icon with custom styles (macOS only)
Cursor Preview
The cursor preview (views/CursorPreview.svelte:1) demonstrates cursor appearance in a mini terminal:Features
- Live cursor animation - Blinks at 1-second intervals
- Style variants - Block, bar, underline, hollow block
- Color customization - Cursor color and text-under-cursor color
- Opacity control - Transparent cursor support
Implementation
Display
The preview shows a git command:Cursor Styles
CSS handles different cursor styles:Font Preview
The font preview (views/FontPreview.svelte:1) shows how terminal text renders with current font settings:Sample Output
What It Tests
- Font family - The actual font face
- Font size - Size in pixels
- Bold/italic - Style rendering
- Unicode - Japanese characters (実行可能ファイル)
- Colored text - Using palette colors
- Icons - Powerline glyphs
- Line spacing - Vertical rhythm
CSS Variables
The preview uses CSS custom properties that update reactively:Base Color Preview
Shows background, foreground, selection colors:- Terminal background color
- Default text (foreground) color
- Selected text appearance
- Selection background/foreground colors
Palette Preview
The palette preview (views/PalettePreview.svelte:1) displays all 256 terminal colors as a grid:Structure
- First 16 colors - Standard ANSI palette (displayed prominently)
- Colors 16-231 - 216-color cube (6×6×6)
- Colors 232-255 - 24-step grayscale
Implementation
App Icon Preview
The icon preview (views/AppIconPreview.svelte:1) shows the macOS app icon with custom styling:Icon Variants
The preview fetches icons from the Ghostty GitHub repository:Custom Style Icons
Forcustom-style mode, the preview composites multiple layers:
Frame Options
- Aluminum - Brushed metal look
- Beige - Vintage computer aesthetic
- Plastic - Glossy plastic finish
- Chrome - Shiny metallic
Color Masks
CSS masks are used to colorize specific parts:Reactive Updates
All previews use Svelte’s reactive system to update instantly:Preview Styling
All previews share common styling:Performance Considerations
Previews are optimized for performance:- CSS variables - Settings are exposed as CSS custom properties, avoiding re-renders
- Derived state - Svelte’s
$derivedonly recomputes when dependencies change - Debouncing - Color picker changes are debounced (not shown in excerpts)
- Lazy loading - Icon images load on-demand
Integration with Settings
Previews are embedded directly in setting panels:Browser Compatibility
Previews require a modern browser with support for:
- CSS custom properties (variables)
- CSS masks (for icon preview)
color-mix()function (optional, for some effects)
- Icons fall back to simple images
- Colors use solid values instead of transparency
- Animations are disabled
Related Features
Settings Editor
Full visual configuration interface
Font Playground
Dedicated font testing environment
Color Schemes
Browse community color themes