Skip to content

Commit a15807a

Browse files
authored
Merge pull request #20 from tailscale/storybook-theming
Tailscale theming for Storybook
2 parents f7e2c74 + 17cae07 commit a15807a

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.storybook/manager.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { addons } from 'storybook/manager-api';
2+
import { create } from "storybook/theming"
3+
import './storybook.css';
4+
5+
addons.setConfig({
6+
theme: create({
7+
base: "light",
8+
fontBase: "'Inter', sans-serif",
9+
10+
brandTitle: "Tailscale Design System",
11+
brandUrl: "https://tailscale.com",
12+
brandImage: "/images/tailscale-logo.svg",
13+
brandTarget: "_self",
14+
15+
colorPrimary: "#4b70cc",
16+
colorSecondary: "#4b70cc",
17+
18+
// UI
19+
appBg: "#ffffff",
20+
21+
// Text colors
22+
textColor: "#232222",
23+
textInverseColor: "#ffffff",
24+
}),
25+
})

.storybook/preview.ts renamed to .storybook/preview.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { Preview } from "@storybook/react";
2+
import { create } from "storybook/theming";
23
import '../src/tailwind.css';
4+
import './storybook.css';
35

46
const preview: Preview = {
57
parameters: {
@@ -9,6 +11,12 @@ const preview: Preview = {
911
date: /Date$/i,
1012
},
1113
},
14+
docs: {
15+
theme: create({
16+
base: "light",
17+
fontBase: "'Inter', sans-serif",
18+
}),
19+
},
1220
},
1321
tags: ['autodocs'],
1422
};

.storybook/storybook.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@font-face {
2+
font-family: "Inter";
3+
font-weight: 100 900;
4+
font-style: normal;
5+
font-display: swap;
6+
src: url("../src/assets/fonts/Inter.var.latin.woff2") format("woff2-variations");
7+
}
8+
9+
@font-face {
10+
font-family: "Inter";
11+
font-weight: 100 900;
12+
font-style: italic;
13+
font-display: swap;
14+
src: url("../src/assets/fonts/Inter.var.italic.latin.woff2") format("woff2-variations");
15+
}

0 commit comments

Comments
 (0)