presetTailwind type error with v1 support #1447
Closed
junichi-chiba
started this conversation in
General
Replies: 1 comment
-
Starting with the upcoming Fresh 1.6 release we'll ship with a proper Tailwind CSS plugin. It uses the same npm package as in node. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have figured out there seems to be a type issue with tailwind v1 support.
I have init the Fresh 1.2, then followed the official steps to add twind v1, described here: https://fresh.deno.dev/docs/examples/using-twind-v1
main.ts:
twind.config.ts:
Then I get a type error on VSCode:
Argument of type '{ selfURL: string; darkMode?: DarkModeConfig; darkColor?: DarkColor<BaseTheme & TailwindTheme & { screens: Record<string, MaybeArray<ScreenValue>>; colors: Record<...>; }> | undefined; ... 7 more ...; finalize...
So it seems that twindConfig is missing correct type inference.
I searched for a solution and found some people attempt to add "as Preset" imported from twind core (https://qiita.com/access3151fq/items/71dcc07978b7e61fe263).
twind.config.ts:
The above code with "as Preset" is working in my new environment without the error.
Now, I have a few points to discuss:
Beta Was this translation helpful? Give feedback.
All reactions