-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanda.config.ts
106 lines (97 loc) · 3.79 KB
/
panda.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { defineConfig } from '@pandacss/dev'
export default defineConfig({
// Whether to use css reset
preflight: true,
// Where to look for your css declarations
include: ['./components/**/*.{ts,tsx,js,jsx}', './app/**/*.{ts,tsx,js,jsx}'],
// Files to exclude
exclude: [],
// presets: [themePreset()],
// outExtension: 'js',
// Useful for theme customization
theme: {
extend: {
breakpoints: {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px'
},
tokens: {
colors: {
hover: { value: '#0026F5' },
active: { value: '#00cc00' },
background: { value: '#fff1e5' },
foreground: { value: '#222222' },
placeholder: { value: '#000000' },
theme: { value: '#fff1e5' },
font: { value: '#222222' }
},
fonts: {
simula: { value: 'var(--font-simula), serif' },
neueMontreal: { value: 'var(--font-neue-montreal), monospace' }
}
}
}
},
patterns: {
extend: {
aspect: {
description: 'An aspect ratio container',
properties: {
ratio: { type: 'number' },
landscapeW: { type: 'string' },
portraitH: { type: 'string' }
},
transform(props: { ratio: number, landscapeW: string, portraitH: string }) {
const { ratio, landscapeW, portraitH } = props
const landscape = ratio < 1
const landscapeWidth = landscapeW
const portraitHeight = portraitH
const calcPortraitWidth = `calc((${portraitH})*(${1 / ratio}))`
const calcLandscapeHeight = `calc((${landscapeW})*(${ratio}))`
return {
width: landscape ? landscapeWidth : calcPortraitWidth,
height: landscape ? calcLandscapeHeight : portraitHeight,
maxWidth: landscapeWidth,
maxHeight: portraitHeight
}
}
},
scrollable: {
description: 'A container that allows for scrolling',
properties: {
// The direction of the scroll
direction: { type: 'enum', value: ['horizontal', 'vertical'] },
// Whether to hide the scrollbar
hideScrollbar: { type: 'boolean' }
},
// disallow the `overflow` property (in TypeScript)
blocklist: ['overflow'],
transform(props: { direction: 'horizontal' | 'vertical'; hideScrollbar: boolean }) {
const { direction, hideScrollbar, ...rest } = props
return {
overflow: 'auto',
height: direction === 'horizontal' ? '100%' : 'auto',
width: direction === 'vertical' ? '100%' : 'auto',
scrollbarWidth: hideScrollbar ? 'none' : 'auto',
WebkitOverflowScrolling: 'touch',
'&::-webkit-scrollbar': {
display: hideScrollbar ? 'none' : 'auto'
},
...rest
}
}
}
}
},
globalCss: {
'html, body': {
margin: '0',
padding: '0'
}
},
// The output directory for your css system
outdir: 'styled-system'
})