mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-09 06:55:07 +00:00
Support tailwind.config.ts (#1247)
Fixes #659 Fixes #633 Create Next App is using `tailwind.config.ts` in the TypeScript template. Since this is a very common use case it would be nice to preserve the type safety of the file. I added new templates for TypeScript files. I see there is an issue #1073 which asks for ESM support as well. This is not included in this PR. I also fixed the type error in the keyframes that is also handled in #636
This commit is contained in:
@@ -51,7 +51,7 @@ test("init config-full", async () => {
|
||||
expect(mockWriteFile).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
expect.stringMatching(/tailwind.config.ts$/),
|
||||
expect.stringContaining(`/** @type {import('tailwindcss').Config} */`),
|
||||
expect.stringContaining(`import type { Config } from "tailwindcss"`),
|
||||
"utf8"
|
||||
)
|
||||
expect(mockWriteFile).toHaveBeenNthCalledWith(
|
||||
@@ -121,7 +121,7 @@ test("init config-partial", async () => {
|
||||
expect(mockWriteFile).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
expect.stringMatching(/tailwind.config.ts$/),
|
||||
expect.stringContaining(`/** @type {import('tailwindcss').Config} */`),
|
||||
expect.stringContaining(`import type { Config } from "tailwindcss"`),
|
||||
"utf8"
|
||||
)
|
||||
expect(mockWriteFile).toHaveBeenNthCalledWith(
|
||||
|
||||
@@ -58,12 +58,12 @@ module.exports = {
|
||||
},
|
||||
keyframes: {
|
||||
"accordion-down": {
|
||||
from: { height: 0 },
|
||||
from: { height: "0" },
|
||||
to: { height: "var(--radix-accordion-content-height)" },
|
||||
},
|
||||
"accordion-up": {
|
||||
from: { height: "var(--radix-accordion-content-height)" },
|
||||
to: { height: 0 },
|
||||
to: { height: "0" },
|
||||
},
|
||||
},
|
||||
animation: {
|
||||
|
||||
Reference in New Issue
Block a user