-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tailwindcss v4 support #239
Comments
I think I have a fix, but it will be a breaking change: diff --git a/src/generator.d.ts b/src/generator.d.ts
index 5b34c70..fd048e2 100644
--- a/src/generator.d.ts
+++ b/src/generator.d.ts
@@ -1,4 +1,4 @@
-import {Config} from "tailwindcss/types/config";
+import {Config} from "tailwindcss";
export type GenerateTypes = {
(theme: Config["theme"]): void;
diff --git a/src/transformer.d.ts b/src/transformer.d.ts
index 508be4d..2953843 100644
--- a/src/transformer.d.ts
+++ b/src/transformer.d.ts
@@ -1,7 +1,7 @@
-import type {Config} from "tailwindcss/types/config";
-import type {DefaultTheme} from "tailwindcss/types/generated/default-theme";
+import type {Config} from "tailwindcss";
+import type DefaultTheme from "tailwindcss/defaultTheme";
-export type DefaultScreens = keyof DefaultTheme["screens"];
+export type DefaultScreens = keyof (typeof DefaultTheme)["screens"];
export type WithTV = {
<C extends Config>(tvConfig: C, config?: TVTransformerConfig): C; |
Also, tailwind variants relies on Module not found: Can't resolve 'tailwindcss/resolveConfig'
1 | import { a } from './chunk-FUBUDMV2.js';
2 | import w from 'tailwindcss/resolveConfig';
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 |
4 | var p={tv:/tv\s*\(((\([^\)]*?\)|\[[^\]]*?\]|.)*?)\)/gs,tvExtend:/extend:\s*\w+(,| )\s*/,comment:/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,blankLine:/^\s*$(?:\r\n?|\n)/gm,extension:/\.\w+/g},l=n=>Array.isArray(n),E=n=>typeof n=="string",d=n=>typeof n=="object",T=n=>typeof n=="boolean",g=n=>typeof n=="function",f=n=>!!(!n||l(n)&&n.length===0||E(n)&&n.length===0||d(n)&&Object.keys(n).length===0),j=(n,r)=>{let t={},e=r.length,s=Object.prototype.hasOwnProperty;for(let a=0;a<e;a++){let o=r[a];s.call(n,o)&&(t[o]=n[o]);}return t},V=(n,r)=>{let t="https://github.com/heroui-inc/tailwind-variants/issues/new/choose";console.log("\x1B[31m%s\x1B[0m",`${n}: ${r.message}`),console.log(`If you think this is an issue, please submit it at ${t}`);},y=(...n)=>r=>n.reduce((t,e)=>e(t),r),S=n=>{let t=n.replace(p.comment,"$1").toString().replace(p.blankLine,"").toString(),e=s=>s[1].replace(p.tvExtend,"").toString();return Array.from(t.matchAll(p.tv),e)},$=n=>{let r=S(n);if(!f(r))return r.map(t=>t.includes("responsiveVariants")?new Function(`
5 | const [options, config] = [${t.toString()}]; |
hi guys I had updated tailwind 3 to 4 but tailwind variants has get error like this [ ERROR ] TypeScript: node_modules/tailwind-variants/dist/transformer.d.ts:1:27
[ ERROR ] TypeScript: node_modules/tailwind-variants/dist/transformer.d.ts:2:33
|
I already reported the error and sent a potential fix above: #239 (comment) |
|
Describe the bug
Now that TailwindCSS v4 dropped, I tried to use the lib
tailwind-variants
with it. But some types seem to have broken on the way. Giving errors like this when building the project:To Reproduce
Steps to reproduce the behavior:
@tailwindcss/vite
andtailwindcss
with the default configurationtailwind-variants
tv()
build
scriptExpected behavior
The project should build seemlesly.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: