@beeq/tailwindcss package is a TailwindCSS preset that wires BEEQ’s design token CSS variables into Tailwind’s theme. Installing it gives you:
- BEEQ color palette (primitive + declarative semantic colors)
- Design token–based spacing, border radius, box shadow, font size, font weight, and line height scales
- CSS variables injected at
:rootfor both the default BEEQ theme and the Endava theme - Automatic light/dark mode switching via
bq-mode="light|dark"HTML attributes - A CSS reset and optional typography styles
ColorMixandLogicalPropertiesTailwind plugins
Prerequisites
Make sure TailwindCSS is already installed and that its directives are present in your main CSS file:Installation
Add the preset
- JavaScript (CJS)
- TypeScript (ESM)
tailwind.config.js
CSS reset
The preset automatically injects a CSS reset into the@base layer. If you want to use your own reset, you can override it in the @base layer:
Fonts
The preset does not load fonts automatically. Add the BEEQ fonts to your main CSS entry file:| Utility | CSS variable | Value |
|---|---|---|
font-default | --bq-font-family | 'Outfit', sans-serif |
font-outfit | --bq-font-family--outfit | Outfit |
font-poppins | --bq-font-family--poppins | Poppins |
Typography plugin
The preset ships a set of default typography styles that map to BEEQ’s type scale. They are not enabled by default — add them via TailwindCSS’splugin API:
- JavaScript (CJS)
- TypeScript (ESM)
tailwind.config.js
TYPOGRAPHY_DEFAULT map adds styles for .display, h1–h6, .caption, .overline, and semibold/bold modifiers:
Design tokens exposed as Tailwind utilities
All tokens below are backed by CSS variables and respond to theme switches.Spacing
| Token | Variable | Value |
|---|---|---|
xs3 | --bq-spacing-xs3 | 2px |
xs2 | --bq-spacing-xs2 | 4px |
xs | --bq-spacing-xs | 8px |
s | --bq-spacing-s | 12px |
m | --bq-spacing-m | 16px |
l | --bq-spacing-l | 24px |
xl | --bq-spacing-xl | 32px |
xxl | --bq-spacing-xxl | 40px |
Border radius
| Token | Variable | Value |
|---|---|---|
none | --bq-radius--none | 0 |
xs2 | --bq-radius--xs2 | 2px |
xs | --bq-radius--xs | 4px |
s | --bq-radius--s | 8px |
m | --bq-radius--m | 12px |
l | --bq-radius--l | 24px |
full | --bq-radius--full | 9999px |
Box shadow
| Token | Variable |
|---|---|
shadow-xs | --bq-box-shadow--xs |
shadow-s | --bq-box-shadow--s |
shadow-m | --bq-box-shadow--m |
shadow-l | --bq-box-shadow--l |
Theme switching
The preset registers multiple theme configurations using CSS attribute selectors. Switch themes by settingbq-theme and bq-mode attributes on your root element: