Skip to content

Commit 0ccdf1a

Browse files
committed
docs: fix tailwind transition not working
1 parent c802d79 commit 0ccdf1a

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

doc-site/docs/showcase/ShowcaseCards.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ const Card: React.FC<CardProps> = ({ name, cover, description, link }) => {
99
return (
1010
<div className="w-72 rounded-lg shadow-md bg-white dark:bg-slate-700 hover:scale-105 transition-transform duration-300">
1111
<a href={link} target="_blank" rel="noopener noreferrer">
12-
<img src={cover} className="w-full h-44 object-cover" />
12+
<img src={cover} className="h-44 w-full object-cover block" />
1313
</a>
14-
<div className="h-32 p-4 flex flex-col">
15-
<p className="text-xl font-semibold dark:text-blue-200">{name}</p>
16-
<p className="mt-1 text-gray-600 dark:text-white line-clamp-3">
14+
<div className="h-24 p-4 flex flex-col">
15+
<div className="text-xl font-semibold dark:text-blue-200">{name}</div>
16+
<div className="mt-1 text-gray-600 dark:text-white line-clamp-3">
1717
{description}
18-
</p>
18+
</div>
1919
</div>
2020
</div>
2121
);

doc-site/tailwind.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/* base 会覆盖所有 md 样式,所以禁用 */
12
/* @tailwind base; */
23
@tailwind components;
34
@tailwind utilities;
5+
6+
/* 声明 base 定义的某些 css 变量,避免某些 tw 动画失效 */
7+
:root {
8+
--tw-translate-x: 0;
9+
--tw-translate-y: 0;
10+
--tw-rotate: 0;
11+
--tw-skew-x: 0;
12+
--tw-skew-y: 0;
13+
--tw-scale-x: 1;
14+
--tw-scale-y: 1;
15+
}

0 commit comments

Comments
 (0)