Skip to content

Commit d938765

Browse files
feat: tailwind 4 in react
1 parent 26753af commit d938765

File tree

8 files changed

+11
-13
lines changed

8 files changed

+11
-13
lines changed

templates/react-starter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121
"@eslint/js": "^9.17.0",
2222
"@junobuild/config": "^0.0.17",
2323
"@junobuild/vite-plugin": "^0.0.19",
24+
"@tailwindcss/postcss": "^4.0.0",
2425
"@types/react": "19.0.0",
2526
"@types/react-dom": "19.0.0",
2627
"@vitejs/plugin-react": "^4.3.4",
27-
"autoprefixer": "^10.4.20",
2828
"eslint": "^9.17.0",
2929
"eslint-plugin-react": "^7.37.2",
3030
"eslint-plugin-react-hooks": "^5.1.0",
3131
"eslint-plugin-react-refresh": "^0.4.16",
3232
"globals": "^15.14.0",
3333
"postcss": "^8.4.49",
3434
"prettier": "^3.4.2",
35-
"tailwindcss": "^3.4.16",
35+
"tailwindcss": "^4.0.0",
3636
"vite": "^6.0.3",
3737
"vite-plugin-node-polyfills": "^0.23.0"
3838
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default {
22
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {}
3+
'@tailwindcss/postcss': {},
54
}
65
};

templates/react-starter/src/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function App() {
1717

1818
return (
1919
<div className="relative isolate min-h-[100dvh]">
20-
<main className="mx-auto max-w-screen-2xl py-16 px-8 md:px-24 tall:min-h-[calc(100dvh-128px)]">
20+
<main className="mx-auto max-w-(--breakpoint-2xl) py-16 px-8 md:px-24 [@media(min-height:800px)]:min-h-[calc(100dvh-128px)]">
2121
<h1 className="dark:text-white text-5xl md:text-6xl font-extrabold md:pt-16">
2222
Welcome to Juno
2323
</h1>

templates/react-starter/src/components/Article.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export const Article = ({href, ariaLabel, children, title}) => {
77
rel="noreferrer noopener"
88
target="_blank"
99
aria-label={ariaLabel}
10-
className="group flex flex-col py-3 px-4 border-black dark:border-lavender-blue-500 dark:hover:border-white border-[3px] rounded bg-white dark:bg-black dark:text-white transition-all shadow-[8px_8px_0px_rgba(0,0,0,1)] dark:shadow-[8px_8px_0px_#7888FF] dark:hover:shadow-[8px_8px_0px_#fff] hover:bg-lavender-blue-200 dark:hover:bg-black active:bg-lavender-blue-400 dark:active:bg-black active:shadow-none active:translate-x-[8px] active:translate-y-[8px]">
11-
<h4 className="sm:text-lg break-words font-extrabold mb-1 dark:text-lavender-blue-500 group-hover:dark:text-white">
10+
className="group flex flex-col py-3 px-4 border-black dark:border-lavender-blue-500 dark:hover:border-white border-[3px] rounded-sm bg-white dark:bg-black dark:text-white transition-all shadow-[8px_8px_0px_rgba(0,0,0,1)] dark:shadow-[8px_8px_0px_#7888FF] dark:hover:shadow-[8px_8px_0px_#fff] hover:bg-lavender-blue-200 dark:hover:bg-black active:bg-lavender-blue-400 dark:active:bg-black active:shadow-none active:translate-x-[8px] active:translate-y-[8px]">
11+
<h4 className="sm:text-lg break-words font-extrabold mb-1 dark:text-lavender-blue-500 dark:group-hover:text-white">
1212
{title}
1313
</h4>
1414

templates/react-starter/src/components/Background.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const Background = () => {
22
return (
3-
<div className="hidden sm:block fixed top-[400px] tall:top-2/4 right-0 -z-10 translate-x-2/4 lg:translate-x-1/3 -translate-y-2/4 min-h-[800px] h-[100dvh] aspect-square">
3+
<div className="hidden sm:block fixed top-[400px] [@media(min-height:800px)]:top-2/4 right-0 -z-10 translate-x-2/4 lg:translate-x-1/3 -translate-y-2/4 min-h-[800px] h-[100dvh] aspect-square">
44
<img
55
src="./juno_illustration.svg"
66
role="presentation"

templates/react-starter/src/components/Footer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const Footer = () => {
22
return (
3-
<footer className="mx-auto max-w-screen-2xl py-16 px-8 md:px-24 h-24 flex items-center justify-between md:justify-start md:gap-24 md:mt-12 dark:text-white">
3+
<footer className="mx-auto max-w-(--breakpoint-2xl) py-16 md:pt-0 px-8 md:px-24 h-24 flex items-center justify-between md:justify-start md:gap-24 md:mt-12 dark:text-white">
44
<span className="flex gap-2 items-baseline">
55
<svg
66
id="Layer_2"

templates/react-starter/src/components/Hero.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const Hero = ({href, ariaLabel, children}) => {
77
rel="noreferrer noopener"
88
target="_blank"
99
aria-label={ariaLabel}
10-
className="col-span-2 text-center text-lg font-extrabold bg-lavender-blue-500 dark:bg-white text-white dark:text-black dark:hover:text-white py-3 px-4 border-black dark:border-lavender-blue-500 dark:hover:border-white border-[3px] rounded transition-all shadow-[8px_8px_0px_rgba(0,0,0,1)] dark:shadow-[8px_8px_0px_#7888FF] dark:hover:shadow-[8px_8px_0px_#fff] hover:bg-lavender-blue-400 dark:hover:bg-black active:bg-lavender-blue-600 dark:active:bg-black active:shadow-none active:translate-x-[8px] active:translate-y-[8px]">
10+
className="col-span-2 text-center text-lg font-extrabold bg-lavender-blue-500 dark:bg-white text-white dark:text-black dark:hover:text-white py-3 px-4 border-black dark:border-lavender-blue-500 dark:hover:border-white border-[3px] rounded-sm transition-all shadow-[8px_8px_0px_rgba(0,0,0,1)] dark:shadow-[8px_8px_0px_#7888FF] dark:hover:shadow-[8px_8px_0px_#fff] hover:bg-lavender-blue-400 dark:hover:bg-black active:bg-lavender-blue-600 dark:active:bg-black active:shadow-none active:translate-x-[8px] active:translate-y-[8px]">
1111
{children}
1212
</a>
1313
);

templates/react-starter/src/index.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
2+
@config '../tailwind.config.js';
43

54
@font-face {
65
font-family: 'JetBrains Mono';

0 commit comments

Comments
 (0)