Tailwind Config
Docsta uses Tailwind CSS for styling, giving you utility-first design control right out of the box. The tailwind.config.js file is where you define theme extensions, plugins, and the paths Tailwind should scan for class names.
Customizing this file lets you make Docsta truly your own—adding brand colors, custom fonts, breakpoints, and more.
1. Basic Configuration
Here’s a sample tailwind.config.js setup used in a typical Docsta project:
// tailwind.config.js
module.exports = {
darkMode: 'class', // Enables class-based dark mode
content: [
'./app/**/*.{js,ts,jsx,tsx}', // For App Router
'./pages/**/*.{js,ts,jsx,tsx}', // For Pages Router
'./components/**/*.{js,ts,jsx,tsx}',
'./lib/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {
colors: {
primary: '#2563eb', // Custom brand color
accent: '#f59e0b',
},
fontFamily: {
sans: ['Inter', 'sans-serif'],
},
},
},
plugins: [
require('@tailwindcss/typography'),
require('@tailwindcss/forms'),
],
}2. darkMode: 'class'
Docsta uses the class strategy for dark mode support, giving you full control using Tailwind’s dark: modifier:
<div className="bg-white dark:bg-zinc-900 text-black dark:text-white">
Hello, dark mode!
</div>Toggle themes by adding or removing the dark class from <html>.
3. Content Paths
The content array tells Tailwind where to scan for class names. This ensures unused styles are purged in production.
Make sure it covers:
'./app/**/*.{js,ts,jsx,tsx}',
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./lib/**/*.{js,ts,jsx,tsx}',If you store MDX or content elsewhere, add those paths too.
4. Theme Extensions
Tailwind’s extend key allows you to override or add to the default design system.
Custom Colors
colors: {
primary: '#1d4ed8',
secondary: '#9333ea',
}Custom Fonts
fontFamily: {
sans: ['Inter', 'sans-serif'],
heading: ['"DM Sans"', 'sans-serif'],
}Custom Spacing, Breakpoints, etc.
spacing: {
72: '18rem',
84: '21rem',
}5. Plugins
Tailwind plugins add pre-built utility classes. Docsta recommends:
@tailwindcss/typography: Great for Markdown or prose content@tailwindcss/forms: Clean form styles
Install them with:
npm install @tailwindcss/typography @tailwindcss/forms6. Optional: Typography Customization
typography: (theme) => ({
DEFAULT: {
css: {
color: theme('colors.zinc.800'),
a: { color: theme('colors.primary') },
strong: { color: theme('colors.primary') },
},
},
dark: {
css: {
color: theme('colors.zinc.200'),
a: { color: theme('colors.accent') },
},
},
}),Use this to match your prose content with your brand styles and dark mode.
Tailwind’s configuration makes Docsta fast to customize and easy to scale—whether you’re styling a single page or building a full design system.
👉 Next Up: Learn how to customize your layout and components using these styles.
What did you think of this content?
It was helpful
It was not helpful
I have a feedback