-
Notifications
You must be signed in to change notification settings - Fork 0
/
uno.config.ts
34 lines (32 loc) · 893 Bytes
/
uno.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
import {
defineConfig,
presetUno,
toEscapedSelector as e,
transformerCompileClass,
} from "unocss";
// https://github.com/microsoft/TypeScript/pull/58176#issuecomment-2052698294
export {} from "unocss/preset-mini";
export default defineConfig({
presets: process.env.NODE_ENV === "development" ? [presetUno()] : [],
rules: [
[
/an-\[([^\]]+)\]-(linear|ease|ease-in|ease-out|ease-in-out)-([\d.]+m?s)(?:-([\d.]+m?s))?(?:-(both|forwards|backwards|none))?/,
([, name, method, duration, delay, fill], { rawSelector }) => {
const selector = e(rawSelector);
return `
@media (prefers-reduced-motion: no-preference) {
${selector} {
animation: ${name} ${duration} ${method} ${delay ?? "0s"} ${fill ?? "both"}
}
}
`;
},
],
],
transformers: [
transformerCompileClass({
classPrefix: "u",
alwaysHash: true,
}),
],
});