Overview
@empathyco/x-tailwindcss is a Tailwind CSS plugin that provides design system utilities, components, and theme configuration for Interface X. It includes pre-built component styles, utility classes, and dynamic variants based on the X design system.
Installation
Setup
Add the plugin to your Tailwind CSS configuration:tailwind.config.js
Features
Pre-built Components
The plugin includes styled components for common Interface X patterns:- Search boxes
- Result cards
- Facet filters
- Buttons and controls
- Modal dialogs
- Dropdown menus
Utility Classes
Custom utility classes for:- Layout patterns
- Spacing system
- Typography scales
- Color schemes
Dynamic Components
Component classes that accept values:Dynamic Utilities
Utility classes with custom values:Theme Configuration
The plugin extends Tailwind’s theme with thex namespace:
tailwind.config.js
Custom Variants
Selected Variant
The plugin adds aselected: variant for styling selected items:
x-selected class:
Component Styles
Search Box
Result Card
Facet Filter
Modal
Utility Classes
Layout
Typography
Spacing
Plugin Architecture
The plugin is built with:Customization
Extending the Theme
tailwind.config.js
Custom Components
Combine plugin classes with custom Tailwind utilities:Using with Vue Components
PostCSS Configuration
Ensure PostCSS is configured to process Tailwind:postcss.config.js
Dependencies
The package depends on:tailwindcss- ^3.4.19 (peer dependency)@empathyco/x-deep-merge- Deep merging utilities@empathyco/x-utils- Utility functions
Development
To preview the design system:Build Output
The plugin provides multiple build formats:dist/cjs/index.js- CommonJS moduledist/esm/index.js- ES moduledist/types/index.d.ts- TypeScript definitionsshowcase/- Built design system showcase
Related Packages
- @empathyco/x-components - Components that use these styles
- @empathyco/x-utils - Utility functions
Resources
GitHub Repository
View source code and examples
Tailwind CSS Docs
Learn more about Tailwind CSS
