Fix Storybook fonts
This commit is contained in:
@@ -16,11 +16,7 @@ const config = {
|
|||||||
options: {},
|
options: {},
|
||||||
},
|
},
|
||||||
staticDirs: ["../public"],
|
staticDirs: ["../public"],
|
||||||
managerHead: (head) => `${head}<base href="/communityrulestorybook/">`,
|
|
||||||
previewHead: (head) => `${head}<base href="/communityrulestorybook/">`,
|
|
||||||
async viteFinal(cfg) {
|
async viteFinal(cfg) {
|
||||||
// IMPORTANT: Set base path for GitHub Pages sub-path hosting
|
|
||||||
cfg.base = "/communityrulestorybook/";
|
|
||||||
// Ensure esbuild treats .js as JSX during dep pre-bundling
|
// Ensure esbuild treats .js as JSX during dep pre-bundling
|
||||||
cfg.optimizeDeps ??= {};
|
cfg.optimizeDeps ??= {};
|
||||||
cfg.optimizeDeps.esbuildOptions ??= {};
|
cfg.optimizeDeps.esbuildOptions ??= {};
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
import "../app/globals.css";
|
import "../app/globals.css";
|
||||||
|
|
||||||
|
// Import Google Fonts for Storybook
|
||||||
|
import { Inter, Bricolage_Grotesque } from "next/font/google";
|
||||||
|
|
||||||
|
const inter = Inter({
|
||||||
|
subsets: ["latin"],
|
||||||
|
weight: ["400", "500"],
|
||||||
|
variable: "--font-inter",
|
||||||
|
});
|
||||||
|
|
||||||
|
const bricolageGrotesque = Bricolage_Grotesque({
|
||||||
|
subsets: ["latin"],
|
||||||
|
weight: ["400", "500"],
|
||||||
|
variable: "--font-bricolage-grotesque",
|
||||||
|
});
|
||||||
|
|
||||||
/** @type { import('@storybook/react').Preview } */
|
/** @type { import('@storybook/react').Preview } */
|
||||||
const preview = {
|
const preview = {
|
||||||
parameters: {
|
parameters: {
|
||||||
@@ -11,6 +26,13 @@ const preview = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
decorators: [
|
||||||
|
(Story) => (
|
||||||
|
<div className={`${inter.variable} ${bricolageGrotesque.variable}`}>
|
||||||
|
<Story />
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export default preview;
|
export default preview;
|
||||||
|
|||||||
@@ -1,5 +1,20 @@
|
|||||||
import "../app/globals.css";
|
import "../app/globals.css";
|
||||||
|
|
||||||
|
// Import Google Fonts for Storybook
|
||||||
|
import { Inter, Bricolage_Grotesque } from "next/font/google";
|
||||||
|
|
||||||
|
const inter = Inter({
|
||||||
|
subsets: ["latin"],
|
||||||
|
weight: ["400", "500"],
|
||||||
|
variable: "--font-inter",
|
||||||
|
});
|
||||||
|
|
||||||
|
const bricolageGrotesque = Bricolage_Grotesque({
|
||||||
|
subsets: ["latin"],
|
||||||
|
weight: ["400", "500"],
|
||||||
|
variable: "--font-bricolage-grotesque",
|
||||||
|
});
|
||||||
|
|
||||||
/** @type { import('@storybook/react').Preview } */
|
/** @type { import('@storybook/react').Preview } */
|
||||||
const preview = {
|
const preview = {
|
||||||
parameters: {
|
parameters: {
|
||||||
@@ -11,6 +26,13 @@ const preview = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
decorators: [
|
||||||
|
(Story) => (
|
||||||
|
<div className={`${inter.variable} ${bricolageGrotesque.variable}`}>
|
||||||
|
<Story />
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
export default preview;
|
export default preview;
|
||||||
|
|||||||
Reference in New Issue
Block a user