Skip to content

Commit

Permalink
refactor(odyssey-storybook): refactor to use new tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
edburyenegren-okta committed May 10, 2023
1 parent c43e19a commit 634ed1d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
32 changes: 16 additions & 16 deletions packages/odyssey-storybook/.storybook/OdysseyTheme.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { create } from "@storybook/theming";
import {
ColorPaletteNeutral000,
ColorPaletteNeutral200,
ColorPaletteNeutral500,
ColorPaletteNeutral600,
ColorPaletteNeutralWhite,
ColorPrimaryBase,
ColorPrimaryDark,
HueNeutral50,
HueNeutral200,
HueNeutral500,
HueNeutral600,
HueNeutralWhite,
PalettePrimaryBase,
PalettePrimaryDark,
ColorTextBody,
ColorTextBodyInverse,
FontFamilyBase,
Expand All @@ -16,13 +16,13 @@ import {
export default create({
base: "light",

colorPrimary: ColorPrimaryBase,
colorSecondary: ColorPrimaryDark,
PalettePrimary: PalettePrimaryBase,
colorSecondary: PalettePrimaryDark,

// UI
appBg: ColorPaletteNeutral000,
appContentBg: ColorPaletteNeutralWhite,
appBorderColor: ColorPaletteNeutral200,
appBg: HueNeutral50,
appContentBg: HueNeutralWhite,
appBorderColor: HueNeutral200,
appBorderRadius: 4,

// Typography
Expand All @@ -34,13 +34,13 @@ export default create({
textInverseColor: ColorTextBodyInverse,

// Toolbar default and active colors
barTextColor: ColorPaletteNeutral600,
barTextColor: HueNeutral600,
barSelectedColor: ColorTextBody,
barBg: ColorPaletteNeutralWhite,
barBg: HueNeutralWhite,

// Form colors
inputBg: ColorPaletteNeutralWhite,
inputBorder: ColorPaletteNeutral500,
inputBg: HueNeutralWhite,
inputBorder: HueNeutral500,
inputTextColor: ColorTextBody,
inputBorderRadius: 4,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ export const TokenTables = (): ReactNode => {
if (!parts) return;

let tokenType = parts[0];
if (parts[0] === "Color") {
if (
parts[0] === "Color" ||
parts[0] === "Hue" ||
parts[0] === "Palette"
) {
tokenType = `${parts[1]} ${parts[0]}s`;
}

Expand Down Expand Up @@ -214,7 +218,8 @@ export const TokenTables = (): ReactNode => {
{token.name.includes("Border") &&
!token.name.includes("ColorBorder") &&
renderBorder(token)}
{token.name.includes("Color") &&
{(token.name.includes("Hue") ||
token.name.includes("Palette")) &&
!token.name.includes("ColorText") &&
renderColor(token.value)}
{token.name.includes("ColorText") &&
Expand Down

0 comments on commit 634ed1d

Please sign in to comment.