Skip to content

Commit

Permalink
feat(theme): update theme color (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinusnathaniel authored Mar 10, 2023
1 parent 2baade1 commit 3fc860e
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/item/ItemCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const ItemCard = ({ value, useAccordion = true }: ItemCardProps) => {
<Grid
padding={{ base: 4, md: 8 }}
border="1px solid"
borderColor={colorMode === "light" ? "gray.200" : "gray.600"}
borderColor={colorMode === "light" ? "gray.200" : "gray.400"}
borderRadius={24}
gap={4}
>
Expand Down
30 changes: 0 additions & 30 deletions src/lib/styles/customTheme.ts

This file was deleted.

16 changes: 16 additions & 0 deletions src/lib/styles/theme/colors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { DeepPartial, Theme } from "@chakra-ui/react";

export const colors: DeepPartial<Theme["colors"]> = {
gray: {
50: "#e8e9e9",
100: "#d1d2d2",
200: "#a3a5a5",
300: "#747978",
400: "#464c4b",
500: "#181f1e",
600: "#131918",
700: "#0e1312",
800: "#0a0c0c",
900: "#050606",
},
};
7 changes: 7 additions & 0 deletions src/lib/styles/theme/components/button.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { ComponentStyleConfig } from "@chakra-ui/react";

export const Button: ComponentStyleConfig = {
baseStyle: {
borderRadius: 24,
},
};
7 changes: 7 additions & 0 deletions src/lib/styles/theme/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Button } from "./button";
import { Input } from "./input";

export const components = {
Button,
Input,
};
11 changes: 11 additions & 0 deletions src/lib/styles/theme/components/input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { ComponentStyleConfig } from "@chakra-ui/react";

export const Input: ComponentStyleConfig = {
sizes: {
lg: {
field: {
borderRadius: 24,
},
},
},
};
5 changes: 5 additions & 0 deletions src/lib/styles/theme/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { ThemeConfig } from "@chakra-ui/react";

export const config: ThemeConfig = {
disableTransitionOnChange: false,
};
6 changes: 6 additions & 0 deletions src/lib/styles/theme/fonts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { DeepPartial, Theme } from "@chakra-ui/react";

export const fonts: DeepPartial<Theme["fonts"]> = {
heading: "Outfit, sans-serif",
body: "Outfit, sans-serif",
};
15 changes: 15 additions & 0 deletions src/lib/styles/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { extendTheme } from "@chakra-ui/react";

import { colors } from "./colors";
import { components } from "./components";
import { config } from "./config";
import { fonts } from "./fonts";

const customTheme = extendTheme({
fonts,
colors,
components,
config,
});

export default customTheme;
4 changes: 2 additions & 2 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ChakraProvider } from "@chakra-ui/react";
import { DefaultSeo } from "next-seo";
import type { AppProps } from "next/app";
import Head from "next/head";
import { DefaultSeo } from "next-seo";
import NextNProgress from "nextjs-progressbar";

import defaultSEOConfig from "../../next-seo.config";
import Layout from "lib/components/layout";
import customTheme from "lib/styles/customTheme";
import customTheme from "lib/styles/theme";
import "lib/styles/globals.css";

const MyApp = ({ Component, pageProps }: AppProps) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { DocumentContext } from "next/document";
import Document, { Html, Head, Main, NextScript } from "next/document";

import { UMAMI_SRC, UMAMI_WEBSITE_ID } from "lib/constants/umami";
import customTheme from "lib/styles/customTheme";
import customTheme from "lib/styles/theme";

export const APP_NAME = "Public APIs";

Expand Down

1 comment on commit 3fc860e

@vercel
Copy link

@vercel vercel bot commented on 3fc860e Mar 10, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.