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

setup(css-library): setup tailwind for all apps with global config in ui package #15

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Changes from 1 commit
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
Next Next commit
setup(css-library): setup tailwind for all apps with global config in…
… ui package
sidarth-23 committed Feb 13, 2024
commit 8d1a95af9a97b774ef3c87fd03a2647f079996f5
1 change: 1 addition & 0 deletions apps/admin/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Metadata } from "next";
import "@repo/ui/global.css"

export const metadata: Metadata = {
title: "Create Next App",
13 changes: 8 additions & 5 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
@@ -9,17 +9,20 @@
"lint": "next lint"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"@repo/ui": "*",
"next": "14.1.0",
"@repo/ui": "*"
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.4.17",
"eslint": "^8",
"eslint-config-next": "14.1.0"
"eslint-config-next": "14.1.0",
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}
1 change: 1 addition & 0 deletions apps/admin/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@repo/ui/postcss.config');
1 change: 1 addition & 0 deletions apps/admin/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "@repo/ui/tailwind.config";
5 changes: 1 addition & 4 deletions apps/learner/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Metadata } from "next";
import "@mantine/core/styles.css";
import { Style } from "@repo/ui";
import "@repo/ui/global.css"

export const metadata: Metadata = {
title: "Create Next App",
@@ -15,9 +14,7 @@ export default function RootLayout({
return (
<html lang="en">
<body>
<Style>
<>{children}</>
</Style>
</body>
</html>
);
13 changes: 8 additions & 5 deletions apps/learner/package.json
Original file line number Diff line number Diff line change
@@ -9,17 +9,20 @@
"lint": "next lint"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"@repo/ui": "*",
"next": "14.1.0",
"@repo/ui": "*"
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.4.17",
"eslint": "^8",
"eslint-config-next": "14.1.0"
"eslint-config-next": "14.1.0",
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}
1 change: 1 addition & 0 deletions apps/learner/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@repo/ui/postcss.config');
1 change: 1 addition & 0 deletions apps/learner/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "@repo/ui/tailwind.config";
3 changes: 3 additions & 0 deletions packages/ui/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
13 changes: 10 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,12 @@
"name": "@repo/ui",
"version": "0.0.0",
"private": true,
"exports": "./src/index.ts",
"exports": {
"./postcss.config": "./postcss.config.js",
"./tailwind.config": "./tailwind.config.ts",
"./*": "./src/index.ts",
"./global.css": "./global.css"
},
"scripts": {
"lint": "eslint . --max-warnings 0",
"generate:component": "turbo gen react-component"
@@ -15,11 +20,13 @@
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"admin": "^1.4.1",
"autoprefixer": "^10.4.17",
"eslint": "^8.56.0",
"learner": "^1.0.0",
"postcss": "^8.4.33",
"postcss-preset-mantine": "^1.12.3",
"postcss-simple-vars": "^7.0.1",
"react": "^18.2.0",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
}
}
6 changes: 6 additions & 0 deletions packages/ui/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
17 changes: 17 additions & 0 deletions packages/ui/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { Config } from "tailwindcss";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create new project for Tailwind.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm done with it. But I'm unable to squash the commits due to git merge in between the commits

const config = {
darkMode: ["class"],
content: [
"./pages/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
"./src/**/*.{ts,tsx}",
"../../packages/ui/src/**/*.{ts,tsx}",
],
prefix: "",
theme: {},
plugins: [],
} satisfies Config;

export default config;
Loading