Skip to content

Commit

Permalink
cleanup around storybook and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-figma committed Jun 10, 2024
1 parent 0cf8fab commit 2e05141
Show file tree
Hide file tree
Showing 32 changed files with 5,954 additions and 3,536 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const config: StorybookConfig = {
...config.resolve.alias,
icons: path.resolve(__dirname, "/src/icons"),
providers: path.resolve(__dirname, "/src/providers"),
"ui/components": path.resolve(__dirname, "/src/ui/components"),
"ui/compositions": path.resolve(__dirname, "/src/ui/compositions"),
"ui/layout": path.resolve(__dirname, "/src/ui/layout"),
"ui/primitives": path.resolve(__dirname, "/src/ui/primitives"),
};
Expand Down
14 changes: 14 additions & 0 deletions .storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Inter:[email protected]&family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap"
rel="stylesheet">


<style>
#storybook-root {
width: 100%;
display: grid;
place-items: center;
}
</style>
8 changes: 8 additions & 0 deletions .storybook/manager.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { addons } from "@storybook/manager-api";
import "../src/index.css";
import "../src/theme.css";
import theme from "./theme";

addons.setConfig({
theme: theme,
});
6 changes: 1 addition & 5 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@
display: grid;
place-items: center;
}
</style>

<script>
// document.documentElement.classList.add("sds-theme-purple")
</script>
</style>
10 changes: 4 additions & 6 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import type { Preview } from "@storybook/react";
import "../src/theme.css";
import "../src/index.css";
import "../src/theme.css";
import theme from "./theme";

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
docs: {
theme: theme,
},
},
};
Expand Down
39 changes: 39 additions & 0 deletions .storybook/theme.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { create } from "@storybook/theming/create";

export default create({
base: "light",
// Typography
fontBase: '"Inter", sans-serif',
fontCode: '"Roboto Mono", monospace',

brandTitle: "Fima SDS",
brandUrl: "https://figma.com",
brandTarget: "_self",

//
colorPrimary: "#3A10E5",
colorSecondary: "#585C6D",

// UI
appBg: "#ffffff",
appContentBg: "#ffffff",
appPreviewBg: "#ffffff",
appBorderColor: "#f5f5f5",
appBorderRadius: 4,

// Text colors
textColor: "#1e1e1e",
textInverseColor: "#ffffff",

// Toolbar default and active colors
barTextColor: "#9E9E9E",
barSelectedColor: "#585C6D",
barHoverColor: "#585C6D",
barBg: "#ffffff",

// Form colors
inputBg: "#ffffff",
inputBorder: "#f5f5f5",
inputTextColor: "#1e1e1e",
inputBorderRadius: 2,
});
2 changes: 1 addition & 1 deletion figma.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"react": {
"importPaths": {
"*": "ui",
"src/ui/components/**/*": "ui/components",
"src/ui/compositions/**/*": "ui/compositions",
"src/ui/layout/**/*": "ui/layout",
"src/ui/primitives/**/*": "ui/primitives",
"src/icons/*": "icons"
Expand Down
Loading

0 comments on commit 2e05141

Please sign in to comment.