Skip to content

Commit

Permalink
feat: support tailwindcss v4 (#4656)
Browse files Browse the repository at this point in the history
* feat: upgrade tailwindcssv4

* feat: upgrade tailwindcssv4

* feat: update config

* feat: first init tailwindcss v4

* fix: update shadow xs to sm

* fix: update rounded xs to sm

* fix: variant issues

* fix: variant shadow etc issues

* fix: variant shadow issues

* fix: redundant shadow issues

* fix: redundant blur-sm issues

* fix: redundant blur-sm issues

* fix: redundant blur-sm shadow issues

* fix: remove redundant rename

* fix: role button issues

* fix: role button issues

* fix: font size

* fix: alpha color value

* fix: support text utilities in plugin

* feat: upgrade tailwind-merge

* fix: pkg package scope

(cherry picked from commit 6e82323)

* fix: button base ui add cursor pointer

* fix: tailwindcss experimental

* feat: upgrade tailwindcss version

* fix: input step 1

* fix: input transition issue

* fix: theme to var function

* ci: run QA in beta branch

* fix: var to the theme and incorrect var usage MER-3261

* feat: upgrade tailwind-variants

---------

Co-authored-by: WK Wong <[email protected]>
Co-authored-by: Junior Garcia <[email protected]>
  • Loading branch information
3 people authored Mar 8, 2025
1 parent 807f009 commit 7ed5ba6
Show file tree
Hide file tree
Showing 166 changed files with 951 additions and 915 deletions.
1 change: 1 addition & 0 deletions .github/workflows/QA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- canary
- beta/release-next

jobs:
build:
Expand Down
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
"source.fixAll.eslint": "explicit"
},
"tailwindCSS.experimental.configFile": {
"packages/storybook/tailwind.config.js": ["packages/core/theme/**/*", "packages/components/**/*"],
"apps/docs/tailwind.config.js": "apps/docs/**/*"
"apps/docs/styles/globals.css": "apps/docs/**/*",
"packages/storybook/.storybook/style.css": ["packages/core/theme/**/*", "packages/components/**/*"],

},
"tailwindCSS.experimental.classRegex": [
["([\"'`][^\"'`]*.*?[\"'`])", "[\"'`]([^\"'`]*).*?[\"'`]"]
],
"cSpell.words": [
"heroui"
],
}
2 changes: 1 addition & 1 deletion apps/docs/app/blog/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface DocsLayoutProps {
export default function DocsLayout({children}: DocsLayoutProps) {
return (
<>
<main className="relative container mx-auto max-w-7xl z-10 px-6 min-h-[calc(100vh_-_64px_-_108px)] mb-12 flex-grow">
<main className="relative container mx-auto max-w-7xl z-10 px-6 min-h-[calc(100vh_-_64px_-_108px)] mb-12 grow">
{children}
</main>
<div
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface DocsLayoutProps {
export default function DocsLayout({children}: DocsLayoutProps) {
return (
<>
<main className="relative container mx-auto max-w-8xl z-10 px-6 min-h-[calc(100vh_-_64px_-_108px)] mb-12 flex-grow">
<main className="relative container mx-auto max-w-8xl z-10 px-6 min-h-[calc(100vh_-_64px_-_108px)] mb-12 grow">
<div className="grid grid-cols-12">
<div className="hidden overflow-visible relative z-10 lg:block lg:col-span-2 mt-8 pr-4">
<DocsSidebar routes={manifest.routes} />
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/examples/navbar/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Content = () => (
<div className="px-6 flex gap-4 flex-col pb-16 flex-grow">
<div className="px-6 flex gap-4 flex-col pb-16 grow">
<h1 className="mt-4 font-bold text-4xl">Lorem ipsum dolor sit amet</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/app/examples/perf/client-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const MyInput = extendVariants(Input, {
inputWrapper: [
"bg-zinc-100",
"border",
"shadow",
"shadow-sm",
"transition-colors",
"focus-within:bg-zinc-100",
"data-[hover=true]:border-zinc-600",
Expand Down Expand Up @@ -138,7 +138,7 @@ const MyInput = extendVariants(Input, {
},
radius: {
xs: {
inputWrapper: "rounded",
inputWrapper: "rounded-sm",
},
sm: {
inputWrapper: "rounded-[4px]",
Expand Down Expand Up @@ -454,7 +454,7 @@ export default function HeroUIPerf() {
classNames: {
base: [
"before:content-[''] before:rounded-t-medium before:fixed before:w-full before:h-14 before:z-10",
"before:top-0 before:left-0 before:bg-gradient-to-b before:from-default-50",
"before:top-0 before:left-0 before:bg-linear-to-b before:from-default-50",
],
},
}}
Expand All @@ -468,7 +468,7 @@ export default function HeroUIPerf() {
{(item) => (
<SelectItem key={item.id} textValue={item.name}>
<div className="flex gap-2 items-center">
<Avatar alt={item.name} className="flex-shrink-0" size="sm" src={item.avatar} />
<Avatar alt={item.name} className="shrink-0" size="sm" src={item.avatar} />
<div className="flex flex-col">
<span className="text-small">{item.name}</span>
<span className="text-tiny text-default-400">{item.email}</span>
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/app/examples/table/custom-styles/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ export default function Page() {
<label className="flex items-center text-default-400 text-small">
Rows per page:
<select
className="bg-transparent outline-none text-default-400 text-small"
className="bg-transparent outline-hidden text-default-400 text-small"
onChange={onRowsPerPageChange}
>
<option value="5">5</option>
Expand Down Expand Up @@ -521,13 +521,13 @@ export default function Page() {
td: [
// changing the rows border radius
// first
"group-data-[first=true]:first:before:rounded-none",
"group-data-[first=true]:last:before:rounded-none",
"first:group-data-[first=true]:before:rounded-none",
"last:group-data-[first=true]:before:rounded-none",
// middle
"group-data-[middle=true]:before:rounded-none",
// last
"group-data-[last=true]:first:before:rounded-none",
"group-data-[last=true]:last:before:rounded-none",
"first:group-data-[last=true]:before:rounded-none",
"last:group-data-[last=true]:before:rounded-none",
],
}),
[],
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/examples/table/use-case/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export default function Page() {
<label className="flex items-center text-default-400 text-small">
Rows per page:
<select
className="bg-transparent outline-none text-default-400 text-small"
className="bg-transparent outline-hidden text-default-400 text-small"
onChange={onRowsPerPageChange}
>
<option value="5">5</option>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {HeroUIProSection} from "@/components/marketing/heroui-pro-section";

export default async function Home() {
return (
<main className="container mx-auto max-w-7xl px-6 flex-grow">
<main className="container mx-auto max-w-7xl px-6 grow">
<section className="flex flex-col items-center justify-center">
<Hero />
<FeaturesGrid features={landingContent.topFeatures} />
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/playground/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PlaygroundTabs from "./playground-tabs";
export default function FigmaPage() {
return (
<>
<main className="prose prose-neutral relative container mx-auto max-w-3xl z-10 px-6 min-h-[calc(100vh_-_64px_-_108px)] mb-12 flex-grow">
<main className="prose prose-neutral relative container mx-auto max-w-3xl z-10 px-6 min-h-[calc(100vh_-_64px_-_108px)] mb-12 grow">
<section className="w-full flex flex-col items-center mt-12 gap-6">
<div className="text-center">
<h1 className="mb-2">Playground</h1>
Expand Down
12 changes: 6 additions & 6 deletions apps/docs/components/cmdk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const cmdk = tv({
"h-14",
"font-sans",
"text-lg",
"outline-none",
"outline-hidden",
"rounded-none",
"bg-transparent",
"text-default-700",
Expand All @@ -78,7 +78,7 @@ const cmdk = tv({
"justify-between",
"items-center",
"rounded-lg",
"shadow",
"shadow-xs",
"bg-content2/50",
"active:opacity-70",
"cursor-pointer",
Expand Down Expand Up @@ -394,10 +394,10 @@ export const Cmdk: FC<{}> = () => {
"mt-[20vh]",
"border-small",
"dark:border-default-100",
"supports-[backdrop-filter]:bg-background/80",
"dark:supports-[backdrop-filter]:bg-background/30",
"supports-[backdrop-filter]:backdrop-blur-md",
"supports-[backdrop-filter]:backdrop-saturate-150",
"supports-backdrop-filter:bg-background/80",
"dark:supports-backdrop-filter:bg-background/30",
"supports-backdrop-filter:backdrop-blur-md",
"supports-backdrop-filter:backdrop-saturate-150",
],
backdrop: ["bg-black/80"],
}}
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/components/demo-code-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export const DemoCodeModal: FC<DemoCodeModalProps> = ({isOpen, code, title, subt
return (
<Modal
classNames={{
backdrop: "z-[100002]", // to appear above the navbar
wrapper: "z-[100003]", // to appear above the backdrop
backdrop: "z-100002", // to appear above the navbar
wrapper: "z-100003", // to appear above the backdrop
}}
isOpen={isOpen}
motionProps={{
Expand Down Expand Up @@ -69,7 +69,7 @@ export const DemoCodeModal: FC<DemoCodeModalProps> = ({isOpen, code, title, subt
<CodeWindow
showCopy
showWindowIcons
className="min-h-[320px] !h-[60vh] max-h-full"
className="min-h-[320px] h-[60vh]! max-h-full"
language="jsx"
title={fileName}
value={code}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/demos/custom-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const CustomButton = () => {
<Button
ref={buttonRef}
disableRipple
className="relative overflow-visible rounded-full hover:-translate-y-1 px-12 shadow-xl bg-background/30 after:content-[''] after:absolute after:rounded-full after:inset-0 after:bg-background/40 after:z-[-1] after:transition after:!duration-500 hover:after:scale-150 hover:after:opacity-0"
className="relative overflow-visible rounded-full hover:-translate-y-1 px-12 shadow-xl bg-background/30 after:content-[''] after:absolute after:rounded-full after:inset-0 after:bg-background/40 after:z-[-1] after:transition after:duration-500! hover:after:scale-150 hover:after:opacity-0"
size="lg"
onPress={handleConfetti}
>
Expand Down
12 changes: 6 additions & 6 deletions apps/docs/components/demos/music-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const MusicPlayer: FC<MusicPlayerProps> = ({className, ...otherProps}) =>
<Button
isIconOnly
aria-label="Like"
className="text-default-900/60 data-[hover]:bg-foreground/10 -translate-y-2 translate-x-2"
className="text-default-900/60 data-hover:bg-foreground/10 -translate-y-2 translate-x-2"
radius="full"
variant="light"
onPress={() => setLiked((v) => !v)}
Expand Down Expand Up @@ -82,7 +82,7 @@ export const MusicPlayer: FC<MusicPlayerProps> = ({className, ...otherProps}) =>
<Button
isIconOnly
aria-label="Repeat"
className="data-[hover]:bg-foreground/10"
className="data-hover:bg-foreground/10"
radius="full"
variant="light"
>
Expand All @@ -91,7 +91,7 @@ export const MusicPlayer: FC<MusicPlayerProps> = ({className, ...otherProps}) =>
<Button
isIconOnly
aria-label="Previous"
className="data-[hover]:bg-foreground/10"
className="data-hover:bg-foreground/10"
radius="full"
variant="light"
>
Expand All @@ -100,7 +100,7 @@ export const MusicPlayer: FC<MusicPlayerProps> = ({className, ...otherProps}) =>
<Button
isIconOnly
aria-label="Play"
className="w-auto h-auto data-[hover]:bg-foreground/10"
className="w-auto h-auto data-hover:bg-foreground/10"
radius="full"
variant="light"
>
Expand All @@ -109,7 +109,7 @@ export const MusicPlayer: FC<MusicPlayerProps> = ({className, ...otherProps}) =>
<Button
isIconOnly
aria-label="Next"
className="data-[hover]:bg-foreground/10"
className="data-hover:bg-foreground/10"
radius="full"
variant="light"
>
Expand All @@ -118,7 +118,7 @@ export const MusicPlayer: FC<MusicPlayerProps> = ({className, ...otherProps}) =>
<Button
isIconOnly
aria-label="Shuffle"
className="data-[hover]:bg-foreground/10"
className="data-hover:bg-foreground/10"
radius="full"
variant="light"
>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/docs/components/codeblock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const CodeBlockHighlight = ({
"px-2": showLines,
},
{
"before:to-code-background before:absolute before:left-0 before:z-0 before:h-full before:w-full before:bg-gradient-to-r before:from-white/10 before:content-[''] before:pointer-events-none":
"before:to-code-background before:absolute before:left-0 before:z-0 before:h-full before:w-full before:bg-linear-to-r before:from-white/10 before:content-[''] before:pointer-events-none":
shouldHighlightLine(i),
},
)}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/docs/components/component-links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ButtonLink = ({
<Button
isExternal
as={Link}
className="!text-small py-4 bg-default-100 dark:bg-default-50 text-default-700"
className="text-small! py-4 bg-default-100 dark:bg-default-50 text-default-700"
href={href}
size="sm"
startContent={startContent}
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/components/docs/heroui-pro-callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const HeroUIProCallout = () => {
<div>
<p className="leading-[1.025] tracking-tight text-center text-large font-semibold">
Ship&nbsp;
<span className="bg-clip-text text-transparent bg-gradient-to-b from-[#5EA2EF] to-[#0072F5]">
<span className="bg-clip-text text-transparent bg-linear-to-b from-[#5EA2EF] to-[#0072F5]">
faster
</span>
<br />
Expand All @@ -37,7 +37,7 @@ export const HeroUIProCallout = () => {
</div>
</div>
<NextLink
className="absolute inset-0 z-[1]"
className="absolute inset-0 z-1"
href="https://heroui.pro/components?utm_source=heroui.com&utm_medium=callout"
onClick={handleClick}
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/docs/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function TreeItem<T>(props: TreeItemProps<T>) {
aria-expanded={dataAttr(hasChildNodes ? isExpanded : undefined)}
aria-selected={dataAttr(isSelected)}
className={clsx(
"flex flex-col outline-none w-full tap-highlight-transparent",
"flex flex-col outline-hidden w-full tap-highlight-transparent",
hasChildNodes ? "mb-4" : "first:mt-4",
// focus ring
...dataFocusVisibleClasses,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/featurebase/fb-roadmap-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const FbRoadmapLink = ({className, innerClassName}: Props) => {
<div className={clsx("relative", innerClassName)}>
Roadmap
<Icon
className="absolute right-[-10px] top-0 outline-none transition-transform group-data-[hover=true]:translate-y-0.5 [&>path]:stroke-[2.5px]"
className="absolute right-[-10px] top-0 outline-hidden transition-transform group-data-[hover=true]:translate-y-0.5 [&>path]:stroke-[2.5px]"
icon={arrowRightUpIcon}
width={10}
/>
Expand Down
16 changes: 8 additions & 8 deletions apps/docs/components/gradient-box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const styles = tv({
base: "flex relative w-full h-auto",
variants: {
to: {
top: "bg-gradient-to-t",
right: "bg-gradient-to-r",
left: "bg-gradient-to-l",
bottom: "bg-gradient-to-b",
"top-right": "bg-gradient-to-tr",
"top-left": "bg-gradient-to-tl",
"bottom-right": "bg-gradient-to-br",
"bottom-left": "bg-gradient-to-bl",
top: "bg-linear-to-t",
right: "bg-linear-to-r",
left: "bg-linear-to-l",
bottom: "bg-linear-to-b",
"top-right": "bg-linear-to-tr",
"top-left": "bg-linear-to-tl",
"bottom-right": "bg-linear-to-br",
"bottom-left": "bg-linear-to-bl",
},
color: {
orange: "from-[#FFB457] to-[#FF705B]",
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/components/heroui-logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const SmallLogoOutlined: React.FC<LogoProps> = ({
...props
}) => (
<svg
className={cn("data-[auto=true]:sm:hidden block text-foreground", className)}
className={cn("sm:data-[auto=true]:hidden block text-foreground", className)}
data-auto={dataAttr(auto)}
fill="none"
height={height || size || 25}
Expand Down Expand Up @@ -50,7 +50,7 @@ export const SmallLogo: React.FC<LogoProps> = ({
...props
}) => (
<svg
className={cn("data-[auto=true]:sm:hidden block text-foreground", className)}
className={cn("sm:data-[auto=true]:hidden block text-foreground", className)}
data-auto={dataAttr(auto)}
fill="none"
height={height || size || 25}
Expand All @@ -73,7 +73,7 @@ export const SmallLogo: React.FC<LogoProps> = ({
export const LargeLogo: React.FC<LogoProps> = ({auto, className, ...props}) => (
<svg
className={cn(
"data-[auto=true]:hidden data-[auto=true]:sm:block block text-foreground",
"data-[auto=true]:hidden sm:data-[auto=true]:block block text-foreground",
className,
)}
data-auto={dataAttr(auto)}
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/components/marketing/a11y-otb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const a11yItems = [
},
];

const iconClasses = "text-2xl text-default-500 pointer-events-none flex-shrink-0";
const iconClasses = "text-2xl text-default-500 pointer-events-none shrink-0";

export const A11yOtb = () => {
const [isModalOpen, setIsModalOpen] = useState(false);
Expand Down Expand Up @@ -148,7 +148,7 @@ export const A11yOtb = () => {
<Button
isIconOnly
aria-label="Show code"
className="absolute top-1 right-1 text-success-50 data-[hover]:bg-foreground/10"
className="absolute top-1 right-1 text-success-50 data-hover:bg-foreground/10"
radius="full"
variant="light"
onPress={() => setIsModalOpen(true)}
Expand Down Expand Up @@ -218,7 +218,7 @@ export const A11yOtb = () => {
description="Permanently delete the file"
shortcut="⌘⇧D"
startContent={
<DeleteDocumentBulkIcon className={clsx(iconClasses, "!text-danger")} />
<DeleteDocumentBulkIcon className={clsx(iconClasses, "text-danger!")} />
}
>
Delete file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export const CustomThemes = () => {
/>
</div>
</div>
<div className="h-full dark:md:block absolute hidden -bottom-[10%] -left-[15%] -z-[1]">
<div className="h-full dark:md:block absolute hidden -bottom-[10%] -left-[15%] -z-1">
<Image
removeWrapper
alt="custom themes background"
Expand Down
Loading

0 comments on commit 7ed5ba6

Please sign in to comment.