-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: minimal setup for storybook like behavior
- Loading branch information
Showing
19 changed files
with
145 additions
and
461 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, { useEffect } from "react"; | ||
import "../styles/globals.css"; | ||
import "./styles.css"; | ||
|
||
import type { GlobalProvider } from "@ladle/react"; | ||
import { ThemeProvider, useTheme } from "next-themes"; | ||
|
||
export const Provider: GlobalProvider = ({ children, globalState }) => { | ||
const { setTheme } = useTheme(); | ||
|
||
useEffect(() => { | ||
setTheme(globalState.theme); | ||
}, [globalState.theme, setTheme]); | ||
|
||
return ( | ||
<div className="container bg-background font-sans" style={{ maxWidth: 800 }}> | ||
<ThemeProvider | ||
attribute="class" | ||
defaultTheme="light" | ||
forcedTheme={globalState.theme} | ||
disableTransitionOnChange | ||
enableSystem | ||
enableColorScheme | ||
> | ||
{children} | ||
</ThemeProvider> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @type {import('@ladle/react').UserConfig} */ | ||
export default { | ||
stories: "**/*.stories.{js,jsx,ts,tsx,mdx}", | ||
}; |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@font-face { | ||
/* includes font-weights from 600-900 */ | ||
font-family: "Europa"; | ||
src: url("/fonts/EuropaGroteskSH-Med.otf"); | ||
font-weight: 600 900; | ||
font-style: normal; | ||
font-display: swap; | ||
} | ||
|
||
@font-face { | ||
/* includes font-weights from 400-500 */ | ||
font-family: "Europa"; | ||
src: url("/fonts/EuropaGroteskSH-Reg.otf"); | ||
font-weight: 400 500; | ||
font-style: normal; | ||
font-display: swap; | ||
} | ||
|
||
@font-face { | ||
/* includes font-weights from 100-300 */ | ||
font-family: "Europa"; | ||
src: url("/fonts/EuropaGroteskSH-Lig.otf"); | ||
font-weight: 100 300; | ||
font-style: normal; | ||
font-display: swap; | ||
} | ||
|
||
:root { | ||
/* define custom css var for the Europa font */ | ||
--font-europa-sans: "Europa", sans-serif; | ||
} | ||
|
||
* { | ||
/* apply letter-spacing to all html elements */ | ||
@apply tracking-wider; | ||
} | ||
|
||
.font-mono { | ||
/* reset the `tracking-wider` on the monospace font */ | ||
letter-spacing: initial; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.