Skip to content

Commit b1a3a70

Browse files
committed
fix storybook
1 parent cdd40db commit b1a3a70

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

.storybook/main.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import type { StorybookConfig } from '@storybook/react-vite';
2+
import { readFileSync } from 'fs';
3+
import { resolve } from 'path';
4+
5+
const packageJson = JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf8'));
26

37
const config: StorybookConfig = {
48
"stories": [
@@ -15,6 +19,24 @@ const config: StorybookConfig = {
1519
"framework": {
1620
"name": "@storybook/react-vite",
1721
"options": {}
18-
}
22+
},
23+
"managerHead": (head) => `
24+
${head}
25+
<style>
26+
.sidebar-header {
27+
border-bottom: 1px solid #e3e6e8;
28+
padding-bottom: 8px;
29+
margin-bottom: 8px;
30+
}
31+
.sidebar-header::after {
32+
content: "v${packageJson.version}";
33+
display: block;
34+
font-size: 11px;
35+
color: #999;
36+
font-weight: normal;
37+
margin-top: 4px;
38+
}
39+
</style>
40+
`
1941
};
2042
export default config;

0 commit comments

Comments
 (0)