Docs

This page isn't translated yet

Tailwind integration

Import Systhema's Tailwind v4 entry, know which Tailwind defaults it changes, or wrap a legacy tailwind.config.

On this page

Systhema ships its utilities, token variables and component CSS as a Tailwind CSS v4 entry. Import it once in your global stylesheet; this page covers the import, the Tailwind defaults it changes, and the legacy config wrapper.

Tailwind v4Link to this section

Import Systhema's Tailwind layer directly in your global stylesheet (app/globals.css or src/styles/globals.css):

app/globals.css
@import '@systhemaui/core/tailwind';

This pulls in:

  • Tailwind v4's CSS-based configuration.
  • All Systhema design-token-derived utilities and CSS variables.
  • The component CSS of every block enabled in your config.

No separate tailwind.config.* file is required.

Where Systhema's rules sit relative to Tailwind's utilities and your own CSS is described on Cascade layers. Which component CSS families are emitted is set by the blocks option.

Theme defaultsLink to this section

The entry keeps Tailwind's utilities but changes some of the theme values behind them. It sets these variables in its @theme:

VariableValue
--breakpoint-*initial
--container-*initial
--spacing4px
--text-xs12px
--text-xs--line-heightcalc(1 / 0.75)
--text-sm14px
--text-sm--line-heightcalc(1.25 / 0.875)
--text-base16px
--text-base--line-heightcalc(1.5 / 1)
--text-lg18px
--text-lg--line-heightcalc(1.75 / 1.125)
--text-xl20px
--text-xl--line-heightcalc(1.75 / 1.25)
--text-2xl24px
--text-2xl--line-heightcalc(2 / 1.5)
--text-3xl30px
--text-3xl--line-heightcalc(2.25 / 1.875)
--text-4xl36px
--text-4xl--line-heightcalc(2.5 / 2.25)
--text-5xl48px
--text-5xl--line-height1
--text-6xl60px
--text-6xl--line-height1
--text-7xl72px
--text-7xl--line-height1
--text-8xl96px
--text-8xl--line-height1
--text-9xl128px
--text-9xl--line-height1
--tracking-tighter-0.8px
--tracking-tight-0.4px
--tracking-normal0px
--tracking-wide0.4px
--tracking-wider0.8px
--tracking-widest1.6px
--radius-xs2px
--radius-sm4px
--radius-md6px
--radius-lg8px
--radius-xl12px
--radius-2xl16px
--radius-3xl24px
--radius-4xl32px

What that means in your markup:

  • Spacing is a 4px grid in pixels. --spacing: 4px makes p-4 16px and gap-6 24px, the same steps as Tailwind's default, but in px, so they do not follow the root font size.
  • Font sizes, letter spacing and radii are in pixels. text-xs to text-9xl keep Tailwind's steps (12px to 128px); tracking-* and rounded-* likewise. For content text, prefer the token text styles.
  • Breakpoints come from your tokens. Tailwind's default breakpoints are removed and the breakpoint variants are the token breakpoints: with the default tokens md: from 640px, lg: from 1192px, xl: from 1366px, 2xl: from 1728px and 3xl: from 2048px. sm: starts at 0px, so it applies everywhere. See Breakpoints and ranges.
  • Tailwind's container scale is removed. max-w-sm to max-w-7xl, w-md and the named container query variants (@md:) produce nothing. Use max-w-container, an arbitrary value such as max-w-[640px], or max-w-prose.
  • container is Systhema's. Tailwind's container utility is switched off, and the class centers content at the token container width. See Container.
Type and radius scales
text-xsTokens to pixels
text-smTokens to pixels
text-baseTokens to pixels
text-lgTokens to pixels
text-xlTokens to pixels
text-2xlTokens to pixels
text-3xlTokens to pixels
text-4xlTokens to pixels
rounded-xs
rounded-sm
rounded-md
rounded-lg
rounded-xl
rounded-2xl
rounded-3xl
const sizes = ['text-xs', 'text-sm', 'text-base', 'text-lg', 'text-xl', 'text-2xl', 'text-3xl', 'text-4xl']
const radii = ['rounded-xs', 'rounded-sm', 'rounded-md', 'rounded-lg', 'rounded-xl', 'rounded-2xl', 'rounded-3xl']

export default function Demo() {
  return (
    <div className="flex w-full flex-col gap-8">
      <div className="flex flex-col gap-2">
        {sizes.map((size) => (
          <div key={size} className="flex items-baseline gap-4">
            <span className="w-20 shrink-0 font-mono text-xs opacity-60">{size}</span>
            <span className={size}>Tokens to pixels</span>
          </div>
        ))}
      </div>
      <div className="flex flex-wrap gap-4">
        {radii.map((radius) => (
          <div key={radius} className="flex flex-col items-center gap-1">
            <div className={`bg-theme-500 size-14 ${radius}`} />
            <span className="font-mono text-[10px] opacity-60">{radius}</span>
          </div>
        ))}
      </div>
    </div>
  )
}

Legacy tailwind.configLink to this section

For projects requiring a traditional Tailwind config, wrap it with withSysthema(). Use this only if you really need it.

tailwind.config.ts
import type { Config } from 'tailwindcss'
import { withSysthema } from '@systhemaui/core'

const config: Config = {
  content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],
  theme: { extend: {} },
  plugins: [],
}

export default withSysthema(config)
tailwind.config.js
const { withSysthema } = require('@systhemaui/core')

/** @type {import('tailwindcss').Config} */
const config = {
  content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],
  theme: { extend: {} },
  plugins: [],
}

module.exports = withSysthema(config)

withSysthema():

  • Deep merges your config with Systhema's defaults.
  • Adds design-token-derived colors, fonts, and screens.
  • Includes all Systhema plugins and utilities.
  • Sets sensible content paths for React, Next, and Payload packages.

Reference the legacy config from CSS:

@import 'tailwindcss' source(none);
@config '../../tailwind.config.js';

Email templatesLink to this section

For React Email templates, @systhemaui/core exports a separate config with email-safe utilities:

import { getEmailTailwindConfig } from '@systhemaui/core'

const tailwindConfig = getEmailTailwindConfig()