mirror of
https://github.com/morten-olsen/refocus.dev.git
synced 2026-02-08 00:46:25 +01:00
init
This commit is contained in:
43
packages/ui/src/theme/provider.tsx
Normal file
43
packages/ui/src/theme/provider.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import { ThemeProvider, createGlobalStyle } from 'styled-components';
|
||||
import { dark } from '../theme';
|
||||
import { styles } from '../typography';
|
||||
type UIProviderProps = {
|
||||
children: React.ReactNode;
|
||||
};
|
||||
// @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap');
|
||||
const GlobalStyle = createGlobalStyle`
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
button {
|
||||
all: unset;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: ${({ theme }) => theme.colors.bg.base};
|
||||
color: ${({ theme }) => theme.colors.text.base};
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
${styles.body}
|
||||
}
|
||||
`;
|
||||
|
||||
const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
|
||||
return (
|
||||
<ThemeProvider theme={dark}>
|
||||
<GlobalStyle />
|
||||
{children}
|
||||
</ThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export { UIProvider };
|
||||
Reference in New Issue
Block a user