Step 1: Install the Required Packages
First, install both the design system and Tailwind CSS in your project: Follow the necessary guide for getting setup using either @studs/styles or @strongtie/design-system Follow the tailwindcss guide for your framework of choiceStep 2: Import Styles
Order of Imports
When using the design system with Tailwind, the import order is crucial:- Import the design system styles first
- Import Tailwind styles second
- Import any additional app-specific styles last
- CSS Imports
- JS Imports
Since the design system styles provides basic preflight and theming. We can
omit the
tailwindcss/theme and tailwindcss/preflight imports. If you need
tailwind in full, use @import “tailwindcss”styles.css
Step 5: Using the design system with Tailwind Classes
You can now combine the design system components with Tailwind utility classes:Step 6: Handling Conflicts
In case of styling conflicts between the design system and Tailwind:- Adjust specificity in your CSS
- Consider using the CSS
@layerdirective to organize overrides (See our [Styles Foundations for Reference])(/foundations/styles#css-cascading-layers)