├── src ├── components │ ├── Box │ │ ├── index.ts │ │ ├── Box.tsx │ │ └── Box.stories.tsx │ ├── Flex │ │ ├── index.ts │ │ ├── Flex.stories.tsx │ │ └── Flex.tsx │ ├── Grid │ │ ├── index.ts │ │ ├── Grid.stories.tsx │ │ └── Grid.tsx │ ├── Link │ │ ├── index.ts │ │ ├── Link.stories.tsx │ │ └── Link.tsx │ ├── Text │ │ ├── index.ts │ │ ├── Text.tsx │ │ └── Text.stories.tsx │ ├── Avatar │ │ ├── index.ts │ │ ├── Avatar.tsx │ │ └── Avatar.stories.tsx │ ├── Button │ │ ├── index.ts │ │ ├── Button.stories.tsx │ │ └── Button.tsx │ ├── Input │ │ ├── index.ts │ │ ├── Input.stories.tsx │ │ └── Input.tsx │ ├── Heading │ │ ├── index.ts │ │ ├── Heading.tsx │ │ └── Heading.stories.tsx │ ├── Container │ │ ├── index.ts │ │ ├── Container.tsx │ │ └── Container.stories.tsx │ ├── Paragraph │ │ ├── index.ts │ │ ├── Paragraph.tsx │ │ └── Paragraph.stories.tsx │ ├── Textarea │ │ ├── index.ts │ │ ├── Textarea.tsx │ │ └── Textarea.stories.tsx │ └── index.ts ├── helper-components │ └── Pre │ │ ├── index.ts │ │ └── Pre.tsx ├── main.tsx ├── theme │ ├── focus.styles.ts │ ├── tailwindColors.ts │ └── stitches.config.ts ├── favicon.svg └── App.tsx ├── .prettierignore ├── .prettierrc ├── vite.config.ts ├── .storybook ├── main.js └── preview.tsx ├── index.html ├── tsconfig.json ├── .gitignore ├── package.json └── README.md /src/components/Box/index.ts: -------------------------------------------------------------------------------- 1 | export { Box } from './Box' 2 | -------------------------------------------------------------------------------- /src/components/Flex/index.ts: -------------------------------------------------------------------------------- 1 | export { Flex } from './Flex' 2 | -------------------------------------------------------------------------------- /src/components/Grid/index.ts: -------------------------------------------------------------------------------- 1 | export { Grid } from './Grid' 2 | -------------------------------------------------------------------------------- /src/components/Link/index.ts: -------------------------------------------------------------------------------- 1 | export { Link } from './Link' 2 | -------------------------------------------------------------------------------- /src/components/Text/index.ts: -------------------------------------------------------------------------------- 1 | export { Text } from './Text' 2 | -------------------------------------------------------------------------------- /src/components/Avatar/index.ts: -------------------------------------------------------------------------------- 1 | export { Avatar } from './Avatar' 2 | -------------------------------------------------------------------------------- /src/components/Button/index.ts: -------------------------------------------------------------------------------- 1 | export { Button } from './Button' 2 | -------------------------------------------------------------------------------- /src/components/Input/index.ts: -------------------------------------------------------------------------------- 1 | export { Input } from './Input' 2 | -------------------------------------------------------------------------------- /src/helper-components/Pre/index.ts: -------------------------------------------------------------------------------- 1 | export { Pre } from './Pre' 2 | -------------------------------------------------------------------------------- /src/components/Heading/index.ts: -------------------------------------------------------------------------------- 1 | export { Heading } from './Heading' 2 | -------------------------------------------------------------------------------- /src/components/Container/index.ts: -------------------------------------------------------------------------------- 1 | export { Container } from './Container' 2 | -------------------------------------------------------------------------------- /src/components/Paragraph/index.ts: -------------------------------------------------------------------------------- 1 | export { Paragraph } from './Paragraph' 2 | -------------------------------------------------------------------------------- /src/components/Textarea/index.ts: -------------------------------------------------------------------------------- 1 | export { Textarea } from './Textarea' 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | public 4 | .yalc 5 | dist 6 | dist-ssr 7 | storybook-static -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "endOfLine": "lf", 3 | "semi": false, 4 | "trailingComma": "all", 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /src/components/Box/Box.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from '../../theme/stitches.config' 2 | 3 | export const Box = styled('div', {}) 4 | -------------------------------------------------------------------------------- /src/components/Paragraph/Paragraph.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from '../../theme/stitches.config' 2 | 3 | export const Paragraph = styled('p', { 4 | boxSizing: 'border-box', 5 | color: '$coolGray600', 6 | }) 7 | -------------------------------------------------------------------------------- /src/components/Container/Container.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from '../../theme/stitches.config' 2 | 3 | export const Container = styled('div', { 4 | width: '97%', 5 | maxWidth: '$container', 6 | margin: '0 auto', 7 | }) 8 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import reactRefresh from '@vitejs/plugin-react-refresh' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [reactRefresh()], 7 | }) 8 | -------------------------------------------------------------------------------- /src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import App from './App' 4 | 5 | ReactDOM.render( 6 | 7 | 8 | , 9 | document.getElementById('root'), 10 | ) 11 | -------------------------------------------------------------------------------- /.storybook/main.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], 3 | addons: [ 4 | '@storybook/addon-essentials', 5 | '@storybook/addon-a11y', 6 | 'storybook-addon-jsx', 7 | ], 8 | } 9 | -------------------------------------------------------------------------------- /src/components/Text/Text.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from '../../theme/stitches.config' 2 | 3 | export const Text = styled('span', { 4 | boxSizing: 'border-box', 5 | 6 | variants: { 7 | variant: { 8 | caps: { 9 | textTransform: 'uppercase', 10 | letterSpacing: '0.2em', 11 | }, 12 | }, 13 | }, 14 | }) 15 | -------------------------------------------------------------------------------- /src/helper-components/Pre/Pre.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from '../../theme/stitches.config' 2 | 3 | export const Pre = styled('pre', { 4 | border: '1px solid', 5 | borderColor: '$coolGray300', 6 | borderRadius: '$default', 7 | wordBreak: 'break-all', 8 | whiteSpace: 'break-spaces', 9 | fontFamily: '$mono', 10 | fontWeight: 'normal', 11 | fontSize: '$2', 12 | p: '$2', 13 | }) 14 | -------------------------------------------------------------------------------- /src/components/Textarea/Textarea.tsx: -------------------------------------------------------------------------------- 1 | import { styled } from '../../theme/stitches.config' 2 | import { sharedInputStyles } from '../Input/Input' 3 | 4 | export const Textarea = styled('textarea', { 5 | display: 'block', 6 | width: '100%', 7 | p: '$2', 8 | appearance: 'none', 9 | fontSize: 'inherit', 10 | fontFamily: 'inherit', 11 | lineHeight: 'inherit', 12 | 13 | ...sharedInputStyles, 14 | }) 15 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Stitches UI 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/components/index.ts: -------------------------------------------------------------------------------- 1 | export { Avatar } from './Avatar' 2 | export { Box } from './Box' 3 | export { Button } from './Button' 4 | export { Container } from './Container' 5 | export { Flex } from './Flex' 6 | export { Grid } from './Grid' 7 | export { Link } from './Link' 8 | export { Text } from './Text' 9 | export { Heading } from './Heading' 10 | export { Paragraph } from './Paragraph' 11 | export { Input } from './Input' 12 | export { Textarea } from './Textarea' 13 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "target": "es5", 5 | "lib": ["DOM", "DOM.Iterable", "ESNext"], 6 | "types": ["vite/client"], 7 | "allowJs": false, 8 | "skipLibCheck": false, 9 | "esModuleInterop": false, 10 | "allowSyntheticDefaultImports": true, 11 | "strict": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "module": "ESNext", 14 | "moduleResolution": "Node", 15 | "resolveJsonModule": true, 16 | "isolatedModules": true, 17 | "noEmit": true, 18 | "jsx": "react", 19 | "noImplicitAny": true 20 | }, 21 | "include": ["./src"] 22 | } 23 | -------------------------------------------------------------------------------- /src/components/Text/Text.stories.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Story, Meta } from '@storybook/react/types-6-0' 3 | import { Text } from './Text' 4 | // import docs from './text.docs.mdx' 5 | 6 | export default { 7 | title: 'Components/Text', 8 | component: Text, 9 | parameters: { 10 | // docs: { page: docs }, 11 | // paddings: [], 12 | /* backgrounds: { 13 | default: 'white', 14 | },*/ 15 | }, 16 | } as Meta 17 | 18 | const Template: Story = (args) => 19 | 20 | export const caps = Template.bind({}) 21 | caps.args = { 22 | children: 'Lorem ipsum dolor sit amet', 23 | variant: 'caps', 24 | } 25 | -------------------------------------------------------------------------------- /src/components/Textarea/Textarea.stories.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Story, Meta } from '@storybook/react/types-6-0' 3 | import { Textarea } from './Textarea' 4 | // import docs from './textarea.docs.mdx' 5 | 6 | export default { 7 | title: 'Components/Textarea', 8 | component: Textarea, 9 | parameters: { 10 | // docs: { page: docs }, 11 | // paddings: [], 12 | /* backgrounds: { 13 | default: 'white', 14 | },*/ 15 | }, 16 | } as Meta 17 | 18 | const Template: Story = (args) => 136 | 137 |
<Textarea rows={8}>Lorem ipsum dolor</Textarea>
138 | 139 | 140 | 141 | ) 142 | } 143 | 144 | export default App 145 | -------------------------------------------------------------------------------- /src/theme/tailwindColors.ts: -------------------------------------------------------------------------------- 1 | // source: https://github.com/tailwindlabs/tailwindcss/blob/master/colors.js 2 | 3 | export const tailwindColors = { 4 | black: '#000', 5 | white: '#fff', 6 | 7 | rose50: '#fff1f2', 8 | rose100: '#ffe4e6', 9 | rose200: '#fecdd3', 10 | rose300: '#fda4af', 11 | rose400: '#fb7185', 12 | rose500: '#f43f5e', 13 | rose600: '#e11d48', 14 | rose700: '#be123c', 15 | rose800: '#9f1239', 16 | rose900: '#881337', 17 | 18 | pink50: '#fdf2f8', 19 | pink100: '#fce7f3', 20 | pink200: '#fbcfe8', 21 | pink300: '#f9a8d4', 22 | pink400: '#f472b6', 23 | pink500: '#ec4899', 24 | pink600: '#db2777', 25 | pink700: '#be185d', 26 | pink800: '#9d174d', 27 | pink900: '#831843', 28 | 29 | fuchsia50: '#fdf4ff', 30 | fuchsia100: '#fae8ff', 31 | fuchsia200: '#f5d0fe', 32 | fuchsia300: '#f0abfc', 33 | fuchsia400: '#e879f9', 34 | fuchsia500: '#d946ef', 35 | fuchsia600: '#c026d3', 36 | fuchsia700: '#a21caf', 37 | fuchsia800: '#86198f', 38 | fuchsia900: '#701a75', 39 | 40 | purple50: '#faf5ff', 41 | purple100: '#f3e8ff', 42 | purple200: '#e9d5ff', 43 | purple300: '#d8b4fe', 44 | purple400: '#c084fc', 45 | purple500: '#a855f7', 46 | purple600: '#9333ea', 47 | purple700: '#7e22ce', 48 | purple800: '#6b21a8', 49 | purple900: '#581c87', 50 | 51 | violet50: '#f5f3ff', 52 | violet100: '#ede9fe', 53 | violet200: '#ddd6fe', 54 | violet300: '#c4b5fd', 55 | violet400: '#a78bfa', 56 | violet500: '#8b5cf6', 57 | violet600: '#7c3aed', 58 | violet700: '#6d28d9', 59 | violet800: '#5b21b6', 60 | violet900: '#4c1d95', 61 | 62 | indigo50: '#eef2ff', 63 | indigo100: '#e0e7ff', 64 | indigo200: '#c7d2fe', 65 | indigo300: '#a5b4fc', 66 | indigo400: '#818cf8', 67 | indigo500: '#6366f1', 68 | indigo600: '#4f46e5', 69 | indigo700: '#4338ca', 70 | indigo800: '#3730a3', 71 | indigo900: '#312e81', 72 | 73 | blue50: '#eff6ff', 74 | blue100: '#dbeafe', 75 | blue200: '#bfdbfe', 76 | blue300: '#93c5fd', 77 | blue400: '#60a5fa', 78 | blue500: '#3b82f6', 79 | blue600: '#2563eb', 80 | blue700: '#1d4ed8', 81 | blue800: '#1e40af', 82 | blue900: '#1e3a8a', 83 | 84 | lightBlue50: '#f0f9ff', 85 | lightBlue100: '#e0f2fe', 86 | lightBlue200: '#bae6fd', 87 | lightBlue300: '#7dd3fc', 88 | lightBlue400: '#38bdf8', 89 | lightBlue500: '#0ea5e9', 90 | lightBlue600: '#0284c7', 91 | lightBlue700: '#0369a1', 92 | lightBlue800: '#075985', 93 | lightBlue900: '#0c4a6e', 94 | 95 | cyan50: '#ecfeff', 96 | cyan100: '#cffafe', 97 | cyan200: '#a5f3fc', 98 | cyan300: '#67e8f9', 99 | cyan400: '#22d3ee', 100 | cyan500: '#06b6d4', 101 | cyan600: '#0891b2', 102 | cyan700: '#0e7490', 103 | cyan800: '#155e75', 104 | cyan900: '#164e63', 105 | 106 | teal50: '#f0fdfa', 107 | teal100: '#ccfbf1', 108 | teal200: '#99f6e4', 109 | teal300: '#5eead4', 110 | teal400: '#2dd4bf', 111 | teal500: '#14b8a6', 112 | teal600: '#0d9488', 113 | teal700: '#0f766e', 114 | teal800: '#115e59', 115 | teal900: '#134e4a', 116 | 117 | emerald50: '#ecfdf5', 118 | emerald100: '#d1fae5', 119 | emerald200: '#a7f3d0', 120 | emerald300: '#6ee7b7', 121 | emerald400: '#34d399', 122 | emerald500: '#10b981', 123 | emerald600: '#059669', 124 | emerald700: '#047857', 125 | emerald800: '#065f46', 126 | emerald900: '#064e3b', 127 | 128 | green50: '#f0fdf4', 129 | green100: '#dcfce7', 130 | green200: '#bbf7d0', 131 | green300: '#86efac', 132 | green400: '#4ade80', 133 | green500: '#22c55e', 134 | green600: '#16a34a', 135 | green700: '#15803d', 136 | green800: '#166534', 137 | green900: '#14532d', 138 | 139 | lime50: '#f7fee7', 140 | lime100: '#ecfccb', 141 | lime200: '#d9f99d', 142 | lime300: '#bef264', 143 | lime400: '#a3e635', 144 | lime500: '#84cc16', 145 | lime600: '#65a30d', 146 | lime700: '#4d7c0f', 147 | lime800: '#3f6212', 148 | lime900: '#365314', 149 | 150 | yellow50: '#fefce8', 151 | yellow100: '#fef9c3', 152 | yellow200: '#fef08a', 153 | yellow300: '#fde047', 154 | yellow400: '#facc15', 155 | yellow500: '#eab308', 156 | yellow600: '#ca8a04', 157 | yellow700: '#a16207', 158 | yellow800: '#854d0e', 159 | yellow900: '#713f12', 160 | 161 | amber50: '#fffbeb', 162 | amber100: '#fef3c7', 163 | amber200: '#fde68a', 164 | amber300: '#fcd34d', 165 | amber400: '#fbbf24', 166 | amber500: '#f59e0b', 167 | amber600: '#d97706', 168 | amber700: '#b45309', 169 | amber800: '#92400e', 170 | amber900: '#78350f', 171 | 172 | orange50: '#fff7ed', 173 | orange100: '#ffedd5', 174 | orange200: '#fed7aa', 175 | orange300: '#fdba74', 176 | orange400: '#fb923c', 177 | orange500: '#f97316', 178 | orange600: '#ea580c', 179 | orange700: '#c2410c', 180 | orange800: '#9a3412', 181 | orange900: '#7c2d12', 182 | 183 | red50: '#fef2f2', 184 | red100: '#fee2e2', 185 | red200: '#fecaca', 186 | red300: '#fca5a5', 187 | red400: '#f87171', 188 | red500: '#ef4444', 189 | red600: '#dc2626', 190 | red700: '#b91c1c', 191 | red800: '#991b1b', 192 | red900: '#7f1d1d', 193 | 194 | warmGray50: '#fafaf9', 195 | warmGray100: '#f5f5f4', 196 | warmGray200: '#e7e5e4', 197 | warmGray300: '#d6d3d1', 198 | warmGray400: '#a8a29e', 199 | warmGray500: '#78716c', 200 | warmGray600: '#57534e', 201 | warmGray700: '#44403c', 202 | warmGray800: '#292524', 203 | warmGray900: '#1c1917', 204 | 205 | trueGray50: '#fafafa', 206 | trueGray100: '#f5f5f5', 207 | trueGray200: '#e5e5e5', 208 | trueGray300: '#d4d4d4', 209 | trueGray400: '#a3a3a3', 210 | trueGray500: '#737373', 211 | trueGray600: '#525252', 212 | trueGray700: '#404040', 213 | trueGray800: '#262626', 214 | trueGray900: '#171717', 215 | 216 | gray50: '#fafafa', 217 | gray100: '#f4f4f5', 218 | gray200: '#e4e4e7', 219 | gray300: '#d4d4d8', 220 | gray400: '#a1a1aa', 221 | gray500: '#71717a', 222 | gray600: '#52525b', 223 | gray700: '#3f3f46', 224 | gray800: '#27272a', 225 | gray900: '#18181b', 226 | 227 | coolGray50: '#f9fafb', 228 | coolGray100: '#f3f4f6', 229 | coolGray200: '#e5e7eb', 230 | coolGray300: '#d1d5db', 231 | coolGray400: '#9ca3af', 232 | coolGray500: '#6b7280', 233 | coolGray600: '#4b5563', 234 | coolGray700: '#374151', 235 | coolGray800: '#1f2937', 236 | coolGray900: '#111827', 237 | 238 | blueGray50: '#f8fafc', 239 | blueGray100: '#f1f5f9', 240 | blueGray200: '#e2e8f0', 241 | blueGray300: '#cbd5e1', 242 | blueGray400: '#94a3b8', 243 | blueGray500: '#64748b', 244 | blueGray600: '#475569', 245 | blueGray700: '#334155', 246 | blueGray800: '#1e293b', 247 | blueGray900: '#0f172a', 248 | } 249 | -------------------------------------------------------------------------------- /src/theme/stitches.config.ts: -------------------------------------------------------------------------------- 1 | import { createCss } from '@stitches/react' 2 | import type { 3 | AlignItemsProperty, 4 | BorderRadiusProperty, 5 | MarginTopProperty, 6 | MarginLeftProperty, 7 | PaddingTopProperty, 8 | WidthProperty, 9 | BackgroundProperty, 10 | } from '@stitches/react/types/css-types' 11 | import { tailwindColors } from './tailwindColors' 12 | 13 | type TLength = (string & {}) | 0 14 | type MarginProperty = MarginTopProperty 15 | type PaddingProperty = PaddingTopProperty 16 | 17 | export const { styled, theme, global } = createCss({ 18 | theme: { 19 | colors: { 20 | ...tailwindColors, 21 | 22 | // Theme UI 23 | text: '$coolGray900', 24 | background: '$coolGray50', 25 | primary: '$blue500', 26 | secondary: '$red500', 27 | accent: '$emerald500', 28 | highlighted: 'blue', 29 | muted: '$coolGray300', 30 | 31 | focus: '$blue200', 32 | }, 33 | fonts: { 34 | sans: 35 | '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif," Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"', 36 | serif: 'Georgia, Cambria, "Times New Roman", Times, serif', 37 | mono: 38 | '"IBM Plex Mono", "JetBrains Mono", "Fira Code", "Input Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', 39 | }, 40 | fontSizes: { 41 | body: '1rem', 42 | 0: '0.625rem', // 10px 43 | 1: '0.75rem', // 12px 44 | 2: '0.875rem', // 14px 45 | 3: '1rem', // 16px - body, h5, h4 46 | 4: '1.125rem', // 18px 47 | 5: '1.25rem', // 20px 48 | 6: '1.375rem', // 22px 49 | 7: '1.5625rem', // 25px - h3 50 | 8: '1.75rem', // 28px 51 | 9: '2rem', // 32px - h2 52 | 10: '2.25rem', // 36px 53 | 11: '2.625rem', // 42px - h1 54 | 12: '2.875rem', // 46px 55 | 13: '3.1875rem', // 51px 56 | }, 57 | fontWeights: { 58 | thin: '100', 59 | extralight: '200', 60 | light: '300', 61 | normal: '400', 62 | medium: '500', 63 | semibold: '600', 64 | bold: '700', 65 | extrabold: '800', 66 | black: '900', 67 | }, 68 | letterSpacings: { 69 | tighter: '-0.05em', 70 | tight: '-0.025em', 71 | normal: '0em', 72 | wide: '0.025em', 73 | wider: '0.05em', 74 | widest: '0.1em', 75 | }, 76 | lineHeights: { 77 | none: '1', 78 | tight: '1.25', 79 | snug: '1.375', 80 | normal: '1.5', 81 | relaxed: '1.625', 82 | loose: '2', 83 | body: '1.625', 84 | heading: 1.15, 85 | }, 86 | borderWidths: {}, 87 | borderStyles: {}, 88 | shadows: {}, 89 | transitions: {}, 90 | space: { 91 | 0: '0rem', // 0px 92 | 1: '0.25rem', // 4px 93 | 2: '0.5rem', // 8px 94 | 3: '0.75rem', // 12px 95 | 4: '1rem', // 16px 96 | 5: '1.5rem', // 24px 97 | 6: '2rem', // 32px 98 | 7: '2.5rem', // 40px 99 | 8: '3rem', // 48px 100 | 9: '3.5rem', // 56px 101 | 10: '4rem', // 64px 102 | 11: '8rem', // 128px 103 | 12: '16rem', // 256px 104 | 13: '32rem', // 512px 105 | }, 106 | sizes: { 107 | 1: '5px', 108 | 2: '10px', 109 | 3: '15px', 110 | 4: '20px', 111 | 5: '25px', 112 | 6: '35px', 113 | 7: '45px', 114 | 8: '65px', 115 | 9: '80px', 116 | container: '1200px', 117 | }, 118 | radii: { 119 | none: '0', 120 | sm: '0.125rem', 121 | default: '0.25rem', 122 | m: '0.4rem', 123 | lg: '0.625rem', 124 | xl: '1rem', 125 | full: '9999px', 126 | round: '50%', 127 | pill: '9999px', 128 | }, 129 | zIndices: { 130 | 1: '100', 131 | 2: '200', 132 | 3: '300', 133 | 4: '400', 134 | max: '999', 135 | }, 136 | }, 137 | media: { 138 | bp1: '(min-width: 640px)', 139 | bp2: '(min-width: 768px)', 140 | bp3: '(min-width: 1024px)', 141 | }, 142 | utils: { 143 | m: () => (value: MarginProperty) => ({ 144 | marginLeft: value, 145 | marginRight: value, 146 | marginTop: value, 147 | marginBottom: value, 148 | }), 149 | mx: () => (value: MarginProperty) => ({ 150 | marginLeft: value, 151 | marginRight: value, 152 | }), 153 | ml: () => (value: MarginProperty) => ({ 154 | marginLeft: value, 155 | }), 156 | mr: () => (value: MarginProperty) => ({ 157 | marginRight: value, 158 | }), 159 | my: () => (value: MarginProperty) => ({ 160 | marginTop: value, 161 | marginBottom: value, 162 | }), 163 | mt: () => (value: MarginProperty) => ({ 164 | marginTop: value, 165 | }), 166 | mb: () => (value: MarginProperty) => ({ 167 | marginBottom: value, 168 | }), 169 | p: () => (value: PaddingProperty) => ({ 170 | paddingLeft: value, 171 | paddingRight: value, 172 | paddingTop: value, 173 | paddingBottom: value, 174 | }), 175 | px: () => (value: PaddingProperty) => ({ 176 | paddingLeft: value, 177 | paddingRight: value, 178 | }), 179 | pl: () => (value: PaddingProperty) => ({ 180 | paddingLeft: value, 181 | }), 182 | pr: () => (value: PaddingProperty) => ({ 183 | paddingRight: value, 184 | }), 185 | py: () => (value: PaddingProperty) => ({ 186 | paddingTop: value, 187 | paddingBottom: value, 188 | }), 189 | pt: () => (value: PaddingProperty) => ({ 190 | paddingTop: value, 191 | }), 192 | pb: () => (value: PaddingProperty) => ({ 193 | paddingBottom: value, 194 | }), 195 | bg: () => (value: BackgroundProperty) => ({ 196 | background: value, 197 | }), 198 | 199 | // Non-Theme-UI utils 200 | size: () => (value: WidthProperty) => ({ 201 | width: value, 202 | height: value, 203 | }), 204 | spaceX: () => (value: MarginLeftProperty) => ({ 205 | '& > * + *': { 206 | marginLeft: value, 207 | }, 208 | }), 209 | spaceY: () => (value: MarginTopProperty) => ({ 210 | '& > * + *': { 211 | marginTop: value, 212 | }, 213 | }), 214 | ai: () => (value: AlignItemsProperty = 'center') => ({ 215 | alignItems: value, 216 | }), 217 | aic: () => () => ({ 218 | alignItems: 'center', 219 | }), 220 | br: () => (value: BorderRadiusProperty) => ({ 221 | borderRadius: value, 222 | }), 223 | }, 224 | }) 225 | 226 | export const globalStyles = global({ 227 | body: { 228 | margin: 0, 229 | fontFamily: '$sans', 230 | bg: '$background', 231 | color: '$coolGray800', 232 | }, 233 | '*, *::before, *::after': { 234 | boxSizing: 'border-box', 235 | }, 236 | }) 237 | --------------------------------------------------------------------------------