-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Kzn 1058 how can we style storybook create a poc (#3347)
* docs(storybook config): style storybook config * docs(storybook theme): add Kaizen logo svg * docs(storybook theme): style subheadings with custom renderLabel prop * docs(storybook theme): use png instead of svg * docs(storybook theme): add type dec for theme object * docs(tailwind theme): prettier fix * docs(tailwind theme): specify /assets as a static dir * docs: update root titles and brand image render method * docs(storybook theme): use 13px and fontweight 600 * docs(storybook theme): change textMutedColor * docs(storybook theme): add css escape hatch for storybook theme * docs(storybook theme): remove unused files * docs(storybook theme): style recently opened header * docs(storybook theme): add comments explaining css hacks --------- Co-authored-by: mcwinter07 <[email protected]>
- Loading branch information
1 parent
495dbd8
commit 4f5765e
Showing
8 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<link | ||
rel="stylesheet" | ||
href="./manager.css" | ||
/> | ||
|
||
|
||
<!--Styles to target and override storybook theme defaults--> | ||
<style> | ||
body .sidebar-item:hover{background:#dfc9ea} | ||
body .search-result-item:hover{background:#dfc9ea} | ||
body .search-result-recentlyOpened{ | ||
text-transform: capitalize; | ||
letter-spacing: normal; | ||
font-size: 13px; | ||
color: #554b5f; | ||
margin-bottom: 8px; | ||
} | ||
body .search-result-back *, | ||
body .search-result-clearHistory *{color:#2f2438} | ||
</style> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file is used by storybook to register installed addons. | ||
// See: https://storybook.js.org/docs/addons/using-addons/ | ||
import React from "react" | ||
import { addons } from "@storybook/addons" | ||
import { defaultTheme } from "@kaizen/design-tokens" | ||
import { CATEGORIES_ICON } from "./constants" | ||
import KaizenTheme from "./theme" | ||
|
||
const colors = defaultTheme.color | ||
|
||
addons.setConfig({ | ||
theme: KaizenTheme, | ||
analyticsGTM: { | ||
gtmId: "GTM-KS4VWLT", | ||
}, | ||
sidebar: { | ||
renderLabel: item => | ||
item.type === "root" ? ( | ||
<span | ||
style={{ | ||
color: colors.purple["800"], | ||
textTransform: "capitalize", | ||
fontSize: "13px", | ||
letterSpacing: "normal", | ||
fontWeight: 600, | ||
}} | ||
> | ||
<span aria-hidden style={{ marginRight: defaultTheme.spacing[6] }}> | ||
{CATEGORIES_ICON[item.name]} | ||
</span> | ||
{item.name} | ||
</span> | ||
) : ( | ||
item.name | ||
), | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
/* eslint import/no-extraneous-dependencies: 0 */ | ||
|
||
import { create } from "@storybook/theming/create" | ||
import { ThemeVars, create } from "@storybook/theming" | ||
import { defaultTheme } from "@kaizen/design-tokens" | ||
const logo = require("./assets/kaizen-badge.svg") | ||
const colors = defaultTheme.color | ||
|
||
export default create({ | ||
// For styles that cannot be achieved through the folowing config, see | ||
// storybook/manager-head.html or storybook/manager.tsx | ||
const theme: ThemeVars = create({ | ||
base: "light", | ||
brandTitle: "🌱 Storybook", | ||
|
||
colorSecondary: colors.purple["600"], | ||
// UI | ||
appBg: colors.purple["100"], | ||
appContentBg: colors.white, | ||
appBorderColor: colors.gray["300"], | ||
appBorderRadius: 7, | ||
// Typography | ||
fontBase: '"Inter", "Noto Sans", Helvetica, Arial, sans-serif', | ||
fontCode: "monospace", | ||
|
||
// Text colors | ||
// Doesn't seem to like CSS Variables wah | ||
textColor: defaultTheme.color.purple["800"], | ||
textColor: colors.purple["800"], | ||
textInverseColor: colors.white, | ||
textMutedColor: "rgba(85, 75, 95)", | ||
// Toolbar default and active colors | ||
barTextColor: colors.gray["600"], | ||
barSelectedColor: colors.purple["600"], | ||
barBg: colors.white, | ||
// Form colors | ||
inputBg: colors.white, | ||
inputBorder: colors.gray["500"], | ||
inputTextColor: colors.gray["600"], | ||
inputBorderRadius: 20, | ||
brandTitle: "Kaizen Storybook", | ||
brandImage: | ||
process.env.IS_DEV === "true" ? logo : "./static/media/kaizen-badge.svg", | ||
}) | ||
|
||
export default theme |