Skip to content

Commit 9443385

Browse files
authored
Merge pull request #18 from tailscale/storybook-theming
Tailscale theming for Storybook
2 parents 37412f5 + d3f37e4 commit 9443385

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Preview } from "@storybook/react";
2-
import '../src/tailwind.css';
2+
import { create } from "storybook/theming";
3+
import './storybook.css';
34

45
const preview: Preview = {
56
parameters: {
@@ -9,6 +10,12 @@ const preview: Preview = {
910
date: /Date$/i,
1011
},
1112
},
13+
docs: {
14+
theme: create({
15+
base: "light",
16+
fontBase: "'Inter', sans-serif",
17+
}),
18+
},
1219
},
1320
tags: ['autodocs'],
1421
};

.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)