Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Fixing custom theme (#16)
Browse files Browse the repository at this point in the history
* feat: общая тема
  • Loading branch information
DieWerkself authored Sep 30, 2023
1 parent f609bfa commit fd5429a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@chakra-ui/system": "^2.6.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fontsource/inter": "^5.0.8",
"@fontsource/raleway": "^5.0.8",
"@tanstack/react-query": "^4.35.3",
"axios": "^1.5.0",
Expand Down
39 changes: 35 additions & 4 deletions src/shared/config/theme/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { extendTheme, defineStyleConfig } from '@chakra-ui/react';
import '@fontsource/raleway/600.css';
import '@fontsource/raleway/700.css';
import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import '@fontsource/inter/700.css';

/**
* Можно посмотреть исходники и понять, что можно переопределить
Expand All @@ -12,24 +18,49 @@ const Button = defineStyleConfig({
},
});

const Heading = defineStyleConfig({
variants: {
h3: {
fontFamily: `'Inter', sans-serif`,
},
},
});

export const basicTheme = extendTheme({
config: {
initialColorMode: 'dark',
initialColorMode: 'light',
useSystemColorMode: false,
},
components: { Button },
components: { Button, Heading },
styles: {
global: {
body: {
fontSize: 'sm',
color: 'gray.900',
},
},
},
fonts: {
body: `'Inter', sans-serif`,
heading: `'Raleway', sans-serif`,
},
colors: {
purple: {
700: '#4A00B5',
100: '#E9D8FD',
600: '#6D2DF0',
900: '#25005B',
100: '#E6DAF7',
},
gray: {
50: '#FAFAFA',
100: '#F5F5F5',
200: '#EEEEEE',
300: '#E0E0E0',
500: '#9E9E9E',
600: '#757575',
400: '#BDBDBD',
700: '#616161',
800: '#424242',
900: '#111111',
},
},
});
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,13 @@ __metadata:
languageName: node
linkType: hard

"@fontsource/inter@npm:^5.0.8":
version: 5.0.8
resolution: "@fontsource/inter@npm:5.0.8"
checksum: d67def08f86681ca21d7ee771fc94b05bd6073f4ccc130f619bb94252b37cda1a9796f0c9991bb7be723f292b6deb014049546be5961bcd5185b439b12ed7d63
languageName: node
linkType: hard

"@fontsource/raleway@npm:^5.0.8":
version: 5.0.8
resolution: "@fontsource/raleway@npm:5.0.8"
Expand Down Expand Up @@ -9970,6 +9977,7 @@ __metadata:
"@commitlint/config-conventional": ^17.7.0
"@emotion/react": ^11.11.1
"@emotion/styled": ^11.11.0
"@fontsource/inter": ^5.0.8
"@fontsource/raleway": ^5.0.8
"@tanstack/eslint-plugin-query": ^4.34.1
"@tanstack/react-query": ^4.35.3
Expand Down

0 comments on commit fd5429a

Please sign in to comment.