Customization Guide
Interface X’s design system is built to be customizable at multiple levels, from theme tokens to component styles.Customization Approaches
There are several ways to customize the design system:1. CSS Custom Properties (Runtime)
The easiest way to customize component colors is using CSS custom properties. Components use CSS variables with fallback values:- Works at runtime (no rebuild needed)
- Can be scoped to specific components
- Supports dynamic theming
- Limited to properties that use CSS variables
2. Extend Tailwind Theme (Build Time)
Extend the plugin’s theme in yourtailwind.config.ts:
tailwind.config.ts
3. Override Default Styles
Add custom CSS that overrides component styles:custom.css
main.css
4. Create Custom Components
Build your own components using the theme tokens:MyButton.vue
Common Customization Scenarios
Brand Colors
Replace the default color palette with your brand colors:Typography
Customize fonts throughout the interface:tailwind.config.ts
Spacing & Sizing
Adjust component sizes and spacing:Border Radius
Change border radius for all components:Dark Mode
Implement dark mode using Tailwind’s dark mode support:tailwind.config.ts
Accessing Theme Tokens
In CSS
Use thetheme() function:
In Tailwind Classes
Theme tokens are not directly accessible as utility classes. Use standard Tailwind utilities or create custom ones:tailwind.config.ts
In JavaScript/TypeScript
For dynamic theming, read CSS variables:Component-Specific Customization
Buttons
Inputs
Suggestions
Best Practices
Use CSS custom properties for runtime theming
Use CSS custom properties for runtime theming
CSS custom properties allow you to change colors dynamically without rebuilding. This is ideal for multi-tenant applications or user-customizable themes.
Extend the theme for compile-time customization
Extend the theme for compile-time customization
Use Tailwind’s theme extension for values that won’t change at runtime. This provides better tree-shaking and smaller bundle sizes.
Maintain consistent spacing
Maintain consistent spacing
Use the spacing scale consistently. Avoid arbitrary values like
12.5px - stick to the predefined scale.Test across breakpoints
Test across breakpoints
Ensure your customizations work well on mobile, tablet, and desktop. Use Tailwind’s responsive modifiers as needed.
Document your customizations
Document your customizations
Keep a record of what you’ve customized and why. This helps maintain consistency and onboard new team members.
Next Steps
Design System
Learn about the design system architecture
Components
Explore available components
