@govtech-bb/design
v1.0.0-alpha.14
Published
Design tokens and Tailwind CSS utilities for GovTechBB Design System
Readme
@govtechbb/design
Design tokens and Tailwind CSS utilities for the GovTechBB Design System.
Installation
npm install @govtech-bb/designUsage
Import the design tokens in your Tailwind CSS file:
@import 'tailwindcss';
/* Import the design tokens */
@import '@govtech-bb/design';
/* You need to add the path to the react components */
@source "../../node_modules/@govtech-bb/react/dist/**/*.js";Design Tokens
Colors
Color Palette
Each color has four shades (00, 100, 40, 10):
Blue:
blue-00- #00164Ablue-100- #00267F (Primary)blue-40- #99A8CCblue-10- #E5E9F2
Yellow:
yellow-00- #E8A833yellow-100- #FFC726yellow-40- #FFE9A8yellow-10- #FFF9E9
Green:
green-00- #00654Agreen-100- #1FBF84green-40- #A5E5CEgreen-10- #E9F9F3
Red:
red-00- #A42C2Cred-100- #FF6B6Bred-40- #FFC4C4red-10- #FFF0F0
Purple:
purple-00- #4A235Apurple-100- #A962C7purple-40- #DDC0E9purple-10- #F6EFF9
Pink:
pink-00- #AD1157pink-100- #FF94D9pink-40- #FFD4F0pink-10- #FFF4FB
Teal:
teal-00- #0E5F64teal-100- #30C0C8teal-40- #ACE6E9teal-10- #EAF9F9
Neutral Colors
Neutral:
black-00- #000000mid-grey-00- #595959grey-00- #E0E4E9white-00- #FFFFFF
Example:
<div className="bg-blue-100 text-white-00">Hello World</div>Typography
Typography Utilities
Use these utility classes for consistent typography:
<h1 className="text-display">Display Text</h1>
<h1 className="text-h1">Heading 1</h1>
<h2 className="text-h2">Heading 2</h2>
<h3 className="text-h3">Heading 3</h3>
<h4 className="text-h4">Heading 4</h4>
<p className="text-body-lg">Large Body Text</p>
<p className="text-body">Body Text</p>Typography Tokens
Or use the tokens directly:
Font Sizes:
font-size-display- 5rem (80px)font-size-h1- 3.5rem (56px)font-size-h2- 2.5rem (40px)font-size-h3- 1.5rem (24px)font-size-h4- 1.25rem (20px)font-size-body-lg- 2rem (32px)font-size-body- 1.25rem (20px)
Line Heights:
line-height-display- 1line-height-h1- 1.15line-height-h2- 1.25line-height-h3- 1.25line-height-h4- 1.4line-height-body-lg- 1.5line-height-body- 1.7
Font Weights:
font-weight-bold- 700font-weight-normal- 400
Shadows
form-hover- Inset shadow for form element hover states
Disabled State
Token:
opacity-disabled- 0.4 (40% opacity for disabled elements)
Utility:
<button className="disabled-state" disabled>
Disabled Button
</button>The disabled-state utility automatically applies:
cursor: not-allowedopacity: 0.4
All form components use this consistent disabled styling.
Modifying Design Tokens
To add or modify design tokens, edit packages/design/src/index.css:
- Add tokens in the
@themeblock for colors, spacing, shadows, etc. - Add custom utilities using
@utilityfor reusable component patterns
