-
Notifications
You must be signed in to change notification settings - Fork 2
styling - chakra #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -0,0 +1,16 @@ | |||
| export const Container = { | |||
| sizes: { | |||
| s: { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chakra already has some global size settings for container theme.sizes.container https://chakra-ui.com/docs/layout/container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but I wanted to create an example with custom size just to show how
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then at least use chakra size keywords xs, sm, md, lg,... https://chakra-ui.com/docs/theming/theme#sizes
| <Global styles={globalStyles} /> | ||
| <Component {...pageProps} /> | ||
| <ChakraProvider theme={theme}> | ||
| <Fonts /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget to preload fonts in _document
<Head>
<link
rel="preload"
href="/fonts/Space-Grotesk/SpaceGrotesk-Regular.woff"
as="font"
type="font/woff"
crossOrigin="true"
/>
</Head>
tsconfig.json
Outdated
| "jsx": "preserve", | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@components/*": ["src/components/*"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't agreed on the syntax yet, but I would go with @/components/* and skip the shared and utilities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsconfig.json
Outdated
| "jsx": "preserve", | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@components/*": ["src/components/*"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| export const Fonts = () => ( | ||
| <Global | ||
| styles={` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs/spaces mix?
Co-authored-by: Darko Kukovec <DarkoKukovec@users.noreply.github.com>
Chakra
Add chakra to example project based on handbook rules.
Features:
https://infinum.com/handbook/books/frontend/react/css-in-js/chakra
https://infinum.com/handbook/books/frontend/react/project-structure#codecomponentscode-folder