generated from deco-sites/fashion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
twind.config.ts
183 lines (175 loc) · 4.73 KB
/
twind.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/**
* WARNING: DO NOT USE ANY TWIND FUNCTIONS in here otherwise the
* vscode-twind-intellisense plugin may stop working. To overcome
* this issue, use animations and keyframes intead of twind's animation
* function.
*/
import type { Options } from "$fresh/plugins/twind.ts";
const gridCols = ([arg]: string[]) => {
const template = Number.isInteger(Number(arg))
? `repeat(${arg}, minmax(0, 1fr))`
: arg
? arg.replace(/(^\[)|(\])$/g, "").replace(/_/g, " ")
: arg;
return {
"grid-template-columns": template,
};
};
const gridRows = ([arg]: string[]) => {
const template = Number.isInteger(Number(arg))
? `repeat(${arg}, minmax(0, 1fr))`
: arg
? arg.replace(/(^\[)|(\])$/g, "").replace(/_/g, " ")
: arg;
return {
"grid-template-rows": template,
};
};
const options: Omit<Options, "selfURL"> = {
theme: {
extend: {
colors: {
"default": "#FFFFFF",
"header": "#FFFFFF",
"badge": "#8C3D3D", // shopping cart tem isso tambem
"footer": "#003232",
"interactive": "#161616",
"interactive-inverse": "#FFFFFF",
"hover": "rgba(0, 0, 0, 0.04)",
"hover-inverse": "rgba(255, 255, 255, 0.4)",
},
textColor: {
"default": "#161616",
"default-inverse": "#FFFFFF",
"subdued": "#66736C",
"subdued-inverse": "#C6C6C6",
"price": "#8C3D3D",
"section-title": "#161616",
"positive": "#1A7346",
"critical": "#B44125",
},
borderColor: {
"default": "#D4DBD7",
"default-inverse": "#FFFFFF",
"interactive": "#161616",
"focus": "#3379EF",
"positive": "#1A7346",
"critical": "#B44125",
},
outline: {
interactive: ["2px solid #3379EF", "2px"],
},
fontSize: {
"heading-1": ["56px", "67.2px"],
"heading-2": ["24px", "28.8px"],
"heading-3": ["20px", "24px"],
"menu": ["16px", "20px"],
"button": ["14px", "18px"],
"body": ["16px", "20px"],
"caption": ["13px", "16px"],
"list-price": ["10px", "20px"],
},
fontWeight: {
"heading-1": "500",
"heading-2": "500",
"heading-3": "500",
"menu": "400",
"button": "700",
"body": "400",
"caption": "400",
"list-price": "400",
},
animation: {
"slide-left": "slide-left-frame 0.4s ease normal",
"slide-right": "slide-right-frame 0.4s ease normal",
"slide-bottom": "slide-bottom-frame 0.4s ease normal",
},
keyframes: {
"slide-left-frame": {
from: { transform: "translateX(100%)" },
to: { transform: "translateX(0)" },
},
"slide-right-frame": {
from: { transform: "translateX(-100%)" },
to: { transform: "translateX(0)" },
},
"slide-bottom-frame": {
from: { transform: "translateY(100%)" },
to: { transform: "translateY(0)" },
},
},
boxShadow: {
sm: "0px 1px 3px 0px #00000014",
default: "0px 1px 4px 0px #0000001F",
md: "0px 1px 5px 0px #00000024",
lg: "0px 4px 10px 0px #0000001F",
},
},
fontFamily: {
sans: ["Albert Sans", "sans-serif"],
serif: ["inherit", "serif"],
},
screens: {
sm: "640px",
md: "768px",
lg: "1024px",
xl: "1280px",
"2xl": "1536px",
},
},
preflight: (preflight) => ({
...preflight,
// Stick footer to the bottom of the page
body: {
display: "flex",
flexDirection: "column",
minHeight: "100vh",
},
'section[data-manifest-key="./sections/Footer.tsx"]': {
marginTop: "auto",
},
// Prevent scroll when modal is open
"body[no-scroll]": {
overflow: "hidden",
height: "100vh",
},
}),
plugins: {
backdrop: {
"&::backdrop": {
background: "rgba(0, 0, 0, 0.5)",
},
},
"scroll-snap-center": {
"scroll-snap-align": "center",
},
"scroll-x-mandatory": {
"scroll-snap-type": "x mandatory",
},
"snap-x": {
"scroll-snap-type": "x var(--tw-scroll-snap-strictness)",
},
"snap-mandatory": {
"--tw-scroll-snap-strictness": "mandatory",
},
"fill": (parts) => ({ "fill": parts.join("-") }),
"max-h-min": {
"max-height": "min-content",
},
"snap": ([mod]) => ({ "scroll-snap-align": mod }),
"grid-cols": gridCols,
"grid-rows": gridRows,
"scroll-smooth": {
"scroll-behavior": "smooth",
"-webkit-overflow-scrolling": "touch",
},
"scrollbar-none": {
"scrollbar-width": "none",
"-ms-overflow-style": "none",
"&::-webkit-scrollbar": {
display: "none",
},
},
},
};
export default options;