mirror of
https://github.com/zoriya/yoshiki.git
synced 2026-06-07 12:15:23 +00:00
Add a readme
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Copyright (c) Zoe Roux and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for details.
|
||||
//
|
||||
|
||||
import { Theme, ThemeProvider, useYoshiki } from "yoshiki";
|
||||
import { AppProps } from "next/app";
|
||||
|
||||
declare module "yoshiki" {
|
||||
export interface Theme {
|
||||
spacing: string;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
export const theme: Theme = {
|
||||
spacing: "24px",
|
||||
name: "yoshiki",
|
||||
};
|
||||
|
||||
const AppName = () => {
|
||||
const { css, theme } = useYoshiki();
|
||||
|
||||
return <p {...css({ padding: (theme) => theme.spacing })}>{theme.name}</p>;
|
||||
};
|
||||
|
||||
const App = ({ Component, pageProps }: AppProps) => {
|
||||
return (
|
||||
<ThemeProvider theme={theme}>
|
||||
<Component {...pageProps} />
|
||||
<AppName />
|
||||
</ThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
Reference in New Issue
Block a user