1
1
import { UnoGenerator , createGenerator } from "@unocss/core" ;
2
- import { type Theme , presetUno } from "@unocss/preset-uno " ;
2
+ import { presetWind3 } from "@unocss/preset-wind3 " ;
3
3
import { presetLegacyCompat } from "@unocss/preset-legacy-compat" ;
4
4
import warnOnce from "warn-once" ;
5
5
import { substituteVariables } from "./substitute" ;
6
6
import { parseCss , type ParsedStyleDecl } from "../parse-css" ;
7
7
8
8
type Warn = ( condition : boolean , message : string ) => void ;
9
9
10
- let unoLazy : UnoGenerator < Theme > | undefined = undefined ;
10
+ let unoLazy : UnoGenerator | undefined = undefined ;
11
11
12
12
const createUnoGenerator = async ( ) => {
13
13
unoLazy = await createGenerator ( {
14
14
presets : [
15
- presetUno ( ) ,
15
+ presetWind3 ( { preflight : "on-demand" } ) ,
16
16
// until we support oklch natively
17
17
presetLegacyCompat ( { legacyColorSpace : true } ) ,
18
18
] ,
@@ -28,10 +28,7 @@ export const parseTailwindToCss = async (
28
28
warn : Warn = warnOnce
29
29
) : Promise < string > => {
30
30
const generator = unoLazy ?? ( await createUnoGenerator ( ) ) ;
31
- const generated = await generator . generate ( classes , {
32
- preflights : true ,
33
- } ) ;
34
-
31
+ const generated = await generator . generate ( classes ) ;
35
32
const cssWithClasses = substituteVariables ( generated . css , warn ) ;
36
33
return cssWithClasses ;
37
34
} ;
0 commit comments