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

Integrate Tailwind CSS #2

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions apps/homeschool/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "tailwind-config/global.css";

export default function RootLayout({
children,
}: {
Expand Down
3 changes: 2 additions & 1 deletion apps/homeschool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@types/react-dom": "^18.0.7",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
"tailwind-config": "workspace:*",
"typescript": "^4.5.3"
}
}
}
1 change: 1 addition & 0 deletions apps/homeschool/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("tailwind-config/postcss.config.js");
1 change: 1 addition & 0 deletions apps/homeschool/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("tailwind-config/tailwind.config.js");
4 changes: 2 additions & 2 deletions apps/homeschooling/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { cssBundleHref } from "@remix-run/css-bundle";
import type { LinksFunction } from "@remix-run/node";
import {
Links,
Expand All @@ -8,9 +7,10 @@ import {
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import stylesheet from "tailwind-config/global.css";

export const links: LinksFunction = () => [
...(cssBundleHref ? [{ rel: "stylesheet", href: cssBundleHref }] : []),
{ rel: "stylesheet", href: stylesheet },
];

export default function App() {
Expand Down
2 changes: 1 addition & 1 deletion apps/homeschooling/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const meta: V2_MetaFunction = () => {
export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
<h1>Welcome to Remix</h1>
<h1 className="text-red-600">Welcome to Remix</h1>
<ul>
<li>
<a
Expand Down
3 changes: 2 additions & 1 deletion apps/homeschooling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"@types/source-map-support": "^0.5.6",
"eslint": "^8.38.0",
"eslint-config-custom": "workspace:*",
"tailwind-config": "workspace:*",
"typescript": "^5.0.4"
},
"engines": {
"node": ">=18.0.0"
}
}
}
1 change: 1 addition & 0 deletions apps/homeschooling/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("tailwind-config/postcss.config.js");
1 change: 1 addition & 0 deletions apps/homeschooling/remix.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
tailwind: true,
ignoredRouteFiles: ["**/.*"],
// When running locally in development mode, we use the built-in remix
// server. This does not understand the vercel lambda module format,
Expand Down
1 change: 1 addition & 0 deletions apps/homeschooling/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("tailwind-config/tailwind.config.js");
3 changes: 3 additions & 0 deletions packages/tailwind-config/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
11 changes: 11 additions & 0 deletions packages/tailwind-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "tailwind-config",
"version": "0.0.0",
"private": true,
"main": "index.js",
"devDependencies": {
"autoprefixer": "^10.4.12",
"postcss": "^8.4.27",
"tailwindcss": "^3.3.0"
}
}
6 changes: 6 additions & 0 deletions packages/tailwind-config/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
11 changes: 11 additions & 0 deletions packages/tailwind-config/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./app/**/*.{js,ts,jsx,tsx}",
"../../packages/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
};
6 changes: 5 additions & 1 deletion packages/ui/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
import * as React from "react";

export const Button = () => {
return <button onClick={() => alert("boop")}>Boop</button>;
return (
<button className="bg-gray-300" onClick={() => alert("boop")}>
Boop
</button>
);
};
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"eslint": "^7.32.0",
"eslint-config-custom": "workspace:*",
"react": "^17.0.2",
"tailwind-config": "workspace:*",
"tsconfig": "workspace:*",
"typescript": "^4.5.2"
}
}
}
1 change: 1 addition & 0 deletions packages/ui/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("tailwind-config/postcss.config.js");
1 change: 1 addition & 0 deletions packages/ui/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("tailwind-config/tailwind.config.js");