Style Guide
This website is a React app built on the Next.js framework with TailwindCSS. I've made it easy for you to duplicate my styles. You can copy and paste the CSS variables into the globals.css
file of your codebase. You'll need to have shadcn/ui set up for semantic styling of components to work out-of-the-box. Not using a framework? I've included agnostic tokens you can use for your own styling.
Themes
Dark mode
This website uses next-themes
to manage light & dark styles and match them to system preferences. The useTheme
hook is used to set and access the current theme and a ThemeProvider
is used to wrap the root layout.
CSS variables
Syntax
hsl()
colour space function according to TailwindCSS guidelines.Semantics
For the following CSS variables:
The background
variable is used for the background colour of the button and the foreground
variable is used for the text colour.
Naming
background
suffix is omitted when the variable is used for the background colour of the component.The background colour of the following Button
styled with Tailwind utility classes will be hsl(var(--primary))
and the foreground colour will be hsl(var(--primary-foreground))
.
Check the shadcn/ui Theming docs for full details on the semantic use of variables.
Custom variables
selection
variable is used for the background colour of the selection highlight. The selection-foreground
variable is used for the text colour of the selection highlight.Want HEX or RGB colours instead?
🤓 I thought you'd never ask.
Tips
HEX | RGB | HSL | LCH | |
---|---|---|---|---|
#FFFFFF | 255, 255, 255 | 0, 0%, 100% | 100%, 0, 0 | |
#0B0B0B | 11, 11, 11 | 224, 71.4%, 4.1% | 14.96%, 0, 0 | |
#FFFFFF | 255, 255, 255 | 0, 0%, 100% | 100%, 0, 0 | |
#0B0B0B | 11, 11, 11 | 224, 71.4%, 4.1% | 14.96% 0 0 | |
#FFFFFF | 255, 255, 255 | 0, 0%, 100% | 100%, 0, 0 | |
#0B0B0B | 11, 11, 11 | 224, 71.4%, 4.1% | 14.96%, 0, 0 | |
#4F46E5 | 79, 70, 229 | 243, 75%, 59% | 41%, 94, 303 | |
#EEF2FF | 238, 242, 255 | 226, 100%, 97% | 96%, 7, 279 | |
#F3F4F6 | 243, 244, 246 | 220, 14.3%, 95.9% | 96.7%, 0.003, 264.54 | |
#111827 | 17, 24, 39 | 220.9, 39.3%, 11% | 21.01%, 0.032, 264.66 |
Components
Radix Primitives
Detailed styles for customized Radix UI components coming soon!
Figma UI kit
You can access a design kit with all the components used on this website with support for Figma variables, props, and theming (dark mode). Use it as a starting point for your own customization with CSS variables and/or Tailwind CSS. Credit to Pietro Schirano (@skirano) for creating the original Figma kit for shadcn/ui.