generated from sonofmagic/monorepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathicestack.config.js
68 lines (65 loc) · 1.83 KB
/
icestack.config.js
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
const mockupPreset = require('@icestack/preset-mockup')
const { css } = require('@icestack/ui')
const { themes, components } = require('./icestack/index')
/**
* @type {import('@icestack/ui').Config}
*/
const config = {
outdir: './my-ui',
base: {
themes: {
...themes,
},
},
components: {
...components,
cbutton: {
selector: '.cbtn',
schema: ({ selector, params, types }) => {
const colors = ['red', 'yellow', 'green']
return {
selector,
defaults: {
base: css`
${selector} {
@apply relative overflow-hidden bg-blue-600 focus:ring-4 focus:ring-blue-300 inline-flex items-center px-7 py-2.5 rounded-lg text-white justify-center;
&::after {
content: '';
@apply absolute inset-0 h-[200%] w-[200%] rotate-45 translate-x-[-75%] transition-all bg-white/30 z-20 duration-1000;
}
&:hover::after {
@apply translate-x-[50%];
}
}
`,
styled: css`
${colors
.map((color) => {
return `${selector}-${color}{
@apply bg-${color}-600 focus:ring-${color}-300;
}`
})
.join('\n')}
`,
utils: css`
${selector}-xs {
@apply px-3 py-1.5 rounded;
}
${selector}-sm {
@apply px-5 py-2 rounded-md;
}
${selector}-md {
@apply px-7 py-2.5 rounded-lg;
}
${selector}-lg {
@apply px-8 py-3 rounded-lg;
}
`,
},
}
},
},
},
presets: [mockupPreset()],
}
module.exports = config