Skip to content
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

Initialize Chakra Theme #100

Merged
merged 5 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { json } from '@remix-run/node';
import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react';

import { getUser } from './session.server';
import theme from './theme';

export const meta: MetaFunction = () => ({
charset: 'utf-8',
Expand Down Expand Up @@ -37,7 +38,7 @@ function Document({ children }: { children: React.ReactNode }) {
export default function App() {
return (
<Document>
<ChakraProvider>
<ChakraProvider theme={theme}>
<Outlet />
</ChakraProvider>
Comment on lines +41 to 43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use ChakraBaseProvider to only focus the theme on components that we actually want to have a different color like, button, box, grids, etc. The website is not big so it's not a big deal, but it's just a suggestion

</Document>
Expand Down
4 changes: 1 addition & 3 deletions app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ export default function Index() {
<Text fontSize="xl">Start making your own custom domains and certificates today!</Text>
<Text>Welcome {data.username}</Text>
<Form action="/logout" method="post">
<Button type="submit" colorScheme="red">
Logout
</Button>
<Button type="submit">Logout</Button>
</Form>
</main>
);
Expand Down
4 changes: 1 addition & 3 deletions app/routes/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export default function Login() {
<Form method="post">
<Heading>Login</Heading>
<Text>You will be logged in (a session will be created for you)</Text>
<Button type="submit" colorScheme="red">
Login
</Button>
<Button type="submit">Login</Button>
</Form>
);
}
16 changes: 16 additions & 0 deletions app/theme/colors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const colors = {
brand: {
50: '#ffe4e3',
100: '#feb7b6',
200: '#f78988',
300: '#f25a59',
400: '#ed2c2b',
500: '#d41312',
600: '#a60c0d',
700: '#770608',
800: '#4a0203',
900: '#200000',
},
};

export default colors;
6 changes: 6 additions & 0 deletions app/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { extendTheme, withDefaultColorScheme } from '@chakra-ui/react';
import colors from './colors';

const theme = extendTheme({ colors }, withDefaultColorScheme({ colorScheme: 'brand' }));

export default theme;