这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(examples): css specificity in Tailwind example #10657

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

Merged
merged 5 commits into from
Jul 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/with-tailwind/apps/docs/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "tailwindcss";
@import "@repo/tailwind-config";
@import "@repo/ui/styles.css";

:root {
--foreground-rgb: 0, 0, 0;
Expand Down
1 change: 1 addition & 0 deletions examples/with-tailwind/apps/docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "@repo/ui/styles.css";
import "./globals.css";
import type { Metadata } from "next";
import { Geist } from "next/font/google";
Expand Down
1 change: 0 additions & 1 deletion examples/with-tailwind/apps/web/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "tailwindcss";
@import "@repo/tailwind-config";
@import "@repo/ui/styles.css";

:root {
--foreground-rgb: 0, 0, 0;
Expand Down
1 change: 1 addition & 0 deletions examples/with-tailwind/apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "@repo/ui/styles.css";
import "./globals.css";
import type { Metadata } from "next";
import { Geist } from "next/font/google";
Expand Down
10 changes: 6 additions & 4 deletions examples/with-tailwind/packages/ui/src/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ export function Card({
}) {
return (
<a
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-neutral-700 hover:bg-neutral-800/30"
className="ui:group ui:rounded-lg ui:border ui:border-transparent ui:px-5 ui:py-4 ui:transition-colors hover:ui:border-neutral-700 hover:ui:bg-neutral-800/30"
href={`${href}?utm_source=create-turbo&utm_medium=with-tailwind&utm_campaign=create-turbo"`}
rel="noopener noreferrer"
target="_blank"
>
<h2 className="mb-3 text-2xl font-semibold">
<h2 className="ui:mb-3 ui:text-2xl ui:font-semibold">
{title}{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
<span className="ui:inline-block ui:transition-transform group-hover:ui:translate-x-1 motion-reduce:ui:transform-none">
-&gt;
</span>
</h2>
<p className="m-0 max-w-[30ch] text-sm opacity-50">{children}</p>
<p className="ui:m-0 ui:max-w-[30ch] ui:text-sm ui:opacity-50">
{children}
</p>
</a>
);
}
6 changes: 3 additions & 3 deletions examples/with-tailwind/packages/ui/src/gradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export function Gradient({
}) {
return (
<span
className={`absolute mix-blend-normal will-change-[filter] rounded-[100%] ${
small ? "blur-[32px]" : "blur-[75px]"
className={`ui:absolute ui:mix-blend-normal ui:will-change-[filter] ui:rounded-[100%] ${
small ? "ui:blur-[32px]" : "ui:blur-[75px]"
} ${
conic
? "bg-[conic-gradient(from_180deg_at_50%_50%,var(--red-1000)_0deg,_var(--purple-1000)_180deg,_var(--blue-1000)_360deg)]"
? "ui:bg-[conic-gradient(from_180deg_at_50%_50%,var(--red-1000)_0deg,_var(--purple-1000)_180deg,_var(--blue-1000)_360deg)]"
: ""
} ${className ?? ""}`}
/>
Expand Down
2 changes: 1 addition & 1 deletion examples/with-tailwind/packages/ui/src/styles.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/* Component-level styles for the UI package */
@import "tailwindcss";
@import "tailwindcss" prefix(ui);
Loading