Skip to main content
The @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 :root for 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
  • ColorMix and LogicalProperties Tailwind plugins

Prerequisites

Make sure TailwindCSS is already installed and that its directives are present in your main CSS file:
@tailwind base;
@tailwind components;
@tailwind utilities;

Installation

npm install -D @beeq/tailwindcss

Add the preset

tailwind.config.js
const beeqPreset = require('@beeq/tailwindcss');

module.exports = {
  content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
  presets: [beeqPreset],
};

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:
@tailwind base;
@layer base {
  /* Your custom reset styles */
}
@tailwind components;
@tailwind utilities;

Fonts

The preset does not load fonts automatically. Add the BEEQ fonts to your main CSS entry file:
/* BEEQ primary font — Outfit */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@100;300;400;600;700&display=swap");

/* Endava brand font — Roboto */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap');
The preset maps these fonts to Tailwind utilities:
UtilityCSS variableValue
font-default--bq-font-family'Outfit', sans-serif
font-outfit--bq-font-family--outfitOutfit
font-poppins--bq-font-family--poppinsPoppins

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’s plugin API:
tailwind.config.js
const plugin = require('tailwindcss/plugin');
const beeqPreset = require('@beeq/tailwindcss');
const { TYPOGRAPHY_DEFAULT } = require('@beeq/tailwindcss');

module.exports = {
  content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
  presets: [beeqPreset],
  plugins: [
    plugin(function ({ addBase }) {
      addBase({ ...TYPOGRAPHY_DEFAULT });
    }),
  ],
};
The TYPOGRAPHY_DEFAULT map adds styles for .display, h1h6, .caption, .overline, and semibold/bold modifiers:
/* Examples of what TYPOGRAPHY_DEFAULT adds */
.display  { font-size: var(--bq-font-size--xxl5); }   /* 64px */
h1, .h1   { font-size: var(--bq-font-size--xxl4); }   /* 56px */
h2, .h2   { font-size: var(--bq-font-size--xxl3); }   /* 48px */
h3, .h3   { font-size: var(--bq-font-size--xxl2); }   /* 40px */
h4, .h4   { font-size: var(--bq-font-size--xxl);  }   /* 32px */
h5, .h5   { font-size: var(--bq-font-size--xl);   }   /* 24px */
h6, .h6   { font-size: var(--bq-font-size--l);    }   /* 18px */
.caption  { font-size: var(--bq-font-size--s);    }   /* 14px */
.overline { font-size: var(--bq-font-size--xs);   }   /* 12px */

Design tokens exposed as Tailwind utilities

All tokens below are backed by CSS variables and respond to theme switches.

Spacing

TokenVariableValue
xs3--bq-spacing-xs32px
xs2--bq-spacing-xs24px
xs--bq-spacing-xs8px
s--bq-spacing-s12px
m--bq-spacing-m16px
l--bq-spacing-l24px
xl--bq-spacing-xl32px
xxl--bq-spacing-xxl40px

Border radius

TokenVariableValue
none--bq-radius--none0
xs2--bq-radius--xs22px
xs--bq-radius--xs4px
s--bq-radius--s8px
m--bq-radius--m12px
l--bq-radius--l24px
full--bq-radius--full9999px

Box shadow

TokenVariable
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 setting bq-theme and bq-mode attributes on your root element:
<!-- Default BEEQ light theme (no attributes needed) -->
<html>

<!-- BEEQ dark mode -->
<html bq-mode="dark">

<!-- Endava light theme -->
<html bq-theme="endava">

<!-- Endava dark mode -->
<html bq-theme="endava" bq-mode="dark">
You can also use CSS class names:
<html class="dark">         <!-- BEEQ dark -->
<html class="endava">       <!-- Endava light -->
<html class="endava dark">  <!-- Endava dark -->

Build docs developers (and LLMs) love