Overview
Yoopta Editor provides flexible styling options through CSS variables, theme packages, and custom CSS. The editor is built with a headless architecture, allowing you to style it completely to match your application’s design system.Theme Packages
Yoopta offers pre-built theme packages that provide styled UI components for all plugins:Available Themes
Shadcn Theme
Production-ready theme using shadcn/ui design tokens
Material Theme
Material Design inspired theme (in progress)
Applying Themes
Apply to all plugins:CSS Variables
Shadcn Theme Variables
The@yoopta/themes-shadcn package uses standard shadcn CSS variables. If you don’t already have shadcn variables defined, import them:
Core Editor Variables
The editor’s base styles use these variables:Custom Styling
Customizing Block Appearance
Target specific block types using data attributes:Customizing Element Appearance
Style specific elements within blocks:Custom Container Styles
Style the editor container:Styling UI Components
Customize toolbar and UI components from@yoopta/ui:
Floating Toolbar
Action Menu
Responsive Design
Make your editor responsive:Print Styles
Optimize for printing:Advanced Customization
Custom Theme Variables
Define your own theme:CSS-in-JS
Use styled-components or emotion:Best Practices
Use CSS variables for consistency
Use CSS variables for consistency
Define global CSS variables to maintain consistent spacing, colors, and typography throughout your editor. This makes theme switching and maintenance easier.
Scope your styles
Scope your styles
Use class prefixes or CSS modules to avoid conflicts with other parts of your application:
Test dark mode
Test dark mode
Always test your custom styles in both light and dark modes. Use CSS variables that adapt to theme changes automatically.
Consider accessibility
Consider accessibility
Ensure sufficient color contrast (WCAG 4.5:1 for normal text, 3:1 for large text). Test keyboard navigation visibility with custom focus styles.
Optimize for performance
Optimize for performance
Avoid expensive CSS operations like shadows and transforms on every block. Use
will-change sparingly and only when needed.Examples
Check out these examples for inspiration:Related
Customization
Learn about customizing plugin behavior
Plugins
Explore available plugins