Skip to content
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

Update tailwind #79

Merged
merged 2 commits into from
Jan 27, 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
3 changes: 2 additions & 1 deletion templates/rescript-template-vite/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ReScript + Vite + React</title>
<link href="/dist/styles.css" rel="stylesheet">
</head>

<body>
<div id="root"></div>
<div id="root" class="h-screen flex justify-center items-center"></div>
<script type="module" src="/src/Main.res.mjs"></script>
</body>

Expand Down
2,871 changes: 1,090 additions & 1,781 deletions templates/rescript-template-vite/package-lock.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions templates/rescript-template-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.15",
"postcss": "^8.4.28",
"tailwindcss": "^3.3.3",
"vite": "^5.0.6"
"@vitejs/plugin-react": "^4.3.4",
"@tailwindcss/vite": "^4.0.0",
"tailwindcss": "^4.0.0",
"vite": "^6.0.0"
}
}
6 changes: 0 additions & 6 deletions templates/rescript-template-vite/postcss.config.cjs

This file was deleted.

42 changes: 0 additions & 42 deletions templates/rescript-template-vite/src/App.css

This file was deleted.

30 changes: 22 additions & 8 deletions templates/rescript-template-vite/src/App.res
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
@module("./assets/rescript-logo.svg")
external rescript: string = "default"

@module("./assets/vite.svg")
external vite: string = "default"

@react.component
let make = () => {
let (count, setCount) = React.useState(() => 0)

<div className="p-6">
<h1 className="text-3xl font-semibold"> {"What is this about?"->React.string} </h1>
<p>
{React.string("This is a simple template for a Vite project using ReScript & Tailwind CSS.")}
</p>
<h2 className="text-2xl font-semibold mt-5"> {React.string("Fast Refresh Test")} </h2>
<div className="max-w-200">
<div className="flex justify-evenly items-center">
<img src={vite} alt={"Vite logo"} className="h-24" />
<img src={rescript} alt={"ReScript logo"} className="h-24" />
</div>
<h1 className="text-6xl m-16 font-semibold text-center"> {"Vite + ReScript"->React.string} </h1>
<Button onClick={_ => setCount(count => count + 1)}>
{React.string(`count is ${count->Int.toString}`)}
</Button>
<p>
<p className="my-6 text-center">
{React.string("Edit ")}
<code> {React.string("src/App.res")} </code>
<code className="bg-stone-100 font-mono rounded"> {React.string("src/App.res")} </code>
{React.string(" and save to test Fast Refresh.")}
</p>
<p className="text-center font-thin text-stone-400">
{React.string("Learn more about ")}
<a
href="https://rescript-lang.org/" target="_blank" className="text-blue-500 hover:underline">
{React.string("ReScript")}
{React.string(".")}
</a>
</p>
</div>
}
5 changes: 2 additions & 3 deletions templates/rescript-template-vite/src/Button.res
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Styling from https://tailwind-elements.com/docs/standard/components/buttons/
let make = props =>
<button
{...
props}
className="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out"
{...props}
className="block cursor-pointer bg-rescript-500 py-3 px-4 my-16 mx-auto text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-rescript-600 hover:shadow-lg focus:bg-rescript-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-rescript-700 active:shadow-lg transition duration-150 ease-in-out"
/>
53 changes: 53 additions & 0 deletions templates/rescript-template-vite/src/assets/rescript-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions templates/rescript-template-vite/src/assets/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 16 additions & 3 deletions templates/rescript-template-vite/src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";

@theme {
--color-rescript-50: oklch(97% 0.02 27);
--color-rescript-100: oklch(93% 0.04 27);
--color-rescript-200: oklch(87% 0.07 27);
--color-rescript-300: oklch(79% 0.12 27);
--color-rescript-400: oklch(71% 0.16 27);
--color-rescript-500: oklch(63% 0.19 27);
--color-rescript-600: oklch(55% 0.17 27);
--color-rescript-700: oklch(47% 0.15 27);
--color-rescript-800: oklch(39% 0.12 27);
--color-rescript-900: oklch(31% 0.09 27);
--color-rescript-950: oklch(23% 0.06 27);
--font-inter: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
}
8 changes: 0 additions & 8 deletions templates/rescript-template-vite/tailwind.config.cjs

This file was deleted.

2 changes: 2 additions & 0 deletions templates/rescript-template-vite/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from '@tailwindcss/vite';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
tailwindcss(),
react({
include: ["**/*.res.mjs"],
}),
Expand Down
Loading