Fix Storybook fonts

This commit is contained in:
adilallo
2025-08-21 20:10:46 -06:00
parent 5f06b31428
commit a8f17cc6c7
3 changed files with 44 additions and 4 deletions
-4
View File
@@ -16,11 +16,7 @@ const config = {
options: {},
},
staticDirs: ["../public"],
managerHead: (head) => `${head}<base href="/communityrulestorybook/">`,
previewHead: (head) => `${head}<base href="/communityrulestorybook/">`,
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
cfg.optimizeDeps ??= {};
cfg.optimizeDeps.esbuildOptions ??= {};
+22
View File
@@ -1,5 +1,20 @@
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 } */
const preview = {
parameters: {
@@ -11,6 +26,13 @@ const preview = {
},
},
},
decorators: [
(Story) => (
<div className={`${inter.variable} ${bricolageGrotesque.variable}`}>
<Story />
</div>
),
],
};
export default preview;
+22
View File
@@ -1,5 +1,20 @@
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 } */
const preview = {
parameters: {
@@ -11,6 +26,13 @@ const preview = {
},
},
},
decorators: [
(Story) => (
<div className={`${inter.variable} ${bricolageGrotesque.variable}`}>
<Story />
</div>
),
],
};
export default preview;