Skip to content

Commit f091a07

Browse files
committed
feat: add tailwind & prettier
1 parent 9313e33 commit f091a07

8 files changed

Lines changed: 1152 additions & 59 deletions

File tree

.prettierrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/** @type {import("prettier").Config} */
2+
const config = {
3+
tabWidth: 4,
4+
useTabs: false,
5+
printWidth: 120,
6+
singleQuote: false,
7+
trailingComma: "all",
8+
/**
9+
* Note:
10+
* The order of plugins in this array is crucial for functionality.
11+
* Do not change the order, as this will prevent both plugins from working correctly.
12+
*/
13+
plugins: ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
14+
importOrder: ["^node:", "<THIRD_PARTY_MODULES>", "^[./]"],
15+
importOrderParserPlugins: ["typescript", "classProperties", "decorators-legacy"],
16+
importOrderSeparation: true,
17+
importOrderSortSpecifiers: true,
18+
tailwindFunctions: ["cn"],
19+
};
20+
21+
module.exports = config;

index.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
html,
6+
body,
7+
#__next {
8+
width: 100%;
9+
height: 100%;
10+
}
11+
12+
.nx-mt-6 {
13+
margin-top: 1.1rem;
14+
}

package.json

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,38 @@
11
{
2-
"name": "nextra-docs-template",
3-
"version": "0.0.1",
4-
"description": "Nextra docs template",
5-
"scripts": {
6-
"dev": "next dev",
7-
"build": "next build",
8-
"start": "next start"
9-
},
10-
"repository": {
11-
"type": "git",
12-
"url": "git+https://github.com/shuding/nextra-docs-template.git"
13-
},
14-
"author": "Shu Ding <g@shud.in>",
15-
"license": "MIT",
16-
"bugs": {
17-
"url": "https://github.com/shuding/nextra-docs-template/issues"
18-
},
19-
"homepage": "https://github.com/shuding/nextra-docs-template#readme",
20-
"dependencies": {
21-
"next": "^13.0.6",
22-
"nextra": "latest",
23-
"nextra-theme-docs": "latest",
24-
"react": "^18.2.0",
25-
"react-dom": "^18.2.0"
26-
},
27-
"devDependencies": {
28-
"@types/node": "18.11.10",
29-
"typescript": "^4.9.3"
30-
}
2+
"name": "nextra-docs-template",
3+
"version": "0.0.1",
4+
"description": "Nextra docs template",
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"postbuild": "next-sitemap"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/shuding/nextra-docs-template.git"
14+
},
15+
"author": "Shu Ding <g@shud.in>",
16+
"license": "MIT",
17+
"bugs": {
18+
"url": "https://github.com/shuding/nextra-docs-template/issues"
19+
},
20+
"homepage": "https://github.com/shuding/nextra-docs-template#readme",
21+
"dependencies": {
22+
"next": "^13.0.6",
23+
"nextra": "latest",
24+
"nextra-theme-docs": "latest",
25+
"react": "^18.2.0",
26+
"react-dom": "^18.2.0"
27+
},
28+
"devDependencies": {
29+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
30+
"@types/node": "18.11.10",
31+
"autoprefixer": "^10.4.19",
32+
"postcss": "^8.4.40",
33+
"prettier": "^3.3.3",
34+
"prettier-plugin-tailwindcss": "^0.6.5",
35+
"tailwindcss": "^3.4.7",
36+
"typescript": "^4.9.3"
37+
}
3138
}

pages/_app.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import "../index.css";
2+
3+
export default function MyApp({ Component, pageProps }) {
4+
return <Component {...pageProps} />;
5+
}

0 commit comments

Comments
 (0)