Skip to content

Commit

Permalink
[UI v2] feat: Adds prefect theming to storybook (#16482)
Browse files Browse the repository at this point in the history
  • Loading branch information
devinvillarosa authored Dec 24, 2024
1 parent 981cde9 commit cbe7dd4
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ui-v2/.storybook/logos/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ui-v2/.storybook/logos/logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions ui-v2/.storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { addons } from "@storybook/manager-api";

import favicon from "../public/ico/favicon-16x16-dark.png";
import { prefectLightTheme } from "./prefect-theme";

addons.setConfig({
theme: prefectLightTheme,
});

// custom favicon
const link = document.createElement("link");
link.setAttribute("rel", "shortcut icon");
link.setAttribute("href", favicon);
document.head.appendChild(link);
21 changes: 21 additions & 0 deletions ui-v2/.storybook/prefect-theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { create } from "@storybook/theming";
import LogoDark from "./logos/logo-dark.svg";
import LogoLight from "./logos/logo-light.svg";

const BASE_THEME = {
brandTitle: "Prefect",
brandUrl: "https://prefect.io",
brandTarget: "_self",
};

export const prefectLightTheme = create({
...BASE_THEME,
base: "light",
brandImage: LogoLight,
});

export const prefectDarkTheme = create({
...BASE_THEME,
base: "dark",
brandImage: LogoDark,
});
42 changes: 36 additions & 6 deletions ui-v2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ui-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/blocks": "^8.4.2",
"@storybook/manager-api": "^8.4.7",
"@storybook/react": "^8.4.2",
"@storybook/react-vite": "^8.4.2",
"@storybook/test": "^8.4.2",
"@storybook/theming": "^8.4.7",
"@tanstack/eslint-plugin-query": "^5.61.6",
"@tanstack/eslint-plugin-router": "^1.77.7",
"@tanstack/router-devtools": "^1.58.15",
Expand Down

0 comments on commit cbe7dd4

Please sign in to comment.