Skip to content

Commit a532a73

Browse files
committed
use tailwindcss
1 parent 977451c commit a532a73

File tree

8 files changed

+89
-11
lines changed

8 files changed

+89
-11
lines changed

.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.prettierrc.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
module.exports = {
2+
plugins: ['prettier-plugin-tailwindcss'],
3+
// 一行最多 120 字符
4+
printWidth: 120,
5+
// 使用 2 个空格缩进
6+
tabWidth: 2,
7+
// 不使用缩进符,而使用空格
8+
useTabs: false,
9+
// 行尾需要有分号
10+
semi: true,
11+
// 使用单引号
12+
singleQuote: true,
13+
// 对象的 key 仅在必要时用引号
14+
quoteProps: 'as-needed',
15+
// jsx 不使用单引号,而使用双引号
16+
jsxSingleQuote: false,
17+
// 末尾需要有逗号
18+
trailingComma: 'all',
19+
// 大括号内的首尾需要空格
20+
bracketSpacing: true,
21+
// 箭头函数,只有一个参数的时候,也需要括号
22+
arrowParens: 'always',
23+
// 不需要写文件开头的 @prettier
24+
requirePragma: false,
25+
// 不需要自动在文件开头插入 @prettier
26+
insertPragma: false,
27+
// 使用默认的折行标准
28+
proseWrap: 'preserve',
29+
// 根据显示样式决定 html 要不要折行
30+
htmlWhitespaceSensitivity: 'css',
31+
// vue 文件中的 script 和 style 内不用缩进
32+
vueIndentScriptAndStyle: false,
33+
// 换行符使用 lf
34+
endOfLine: 'lf',
35+
// 格式化内嵌代码
36+
embeddedLanguageFormatting: 'auto',
37+
};

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"editor.codeActionsOnSave": {
6+
"source.organizeImports": "explicit"
7+
}
8+
}

media/package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,23 @@
3737
"version": "0.3.70",
3838
"repository": "[email protected]:aliyun/alibabacloud-api-vscode-toolkit.git",
3939
"devDependencies": {
40-
"less": "^4.2.0",
41-
"@vitejs/plugin-react": "^1.3.2",
42-
"vite": "^2.9.7",
40+
"@types/blueimp-md5": "^2.7.0",
4341
"@types/fs-extra": "^5.1.0",
4442
"@types/lodash": "^4.14.182",
43+
"@types/node": "^20",
4544
"@types/react": "^18.0.8",
4645
"@types/react-dom": "^18.0.3",
4746
"@types/vscode": "^1.47.0",
4847
"@types/vscode-webview": "^1.57.0",
49-
"@types/blueimp-md5": "^2.7.0"
48+
"@vitejs/plugin-react": "^1.3.2",
49+
"autoprefixer": "^10.0.1",
50+
"eslint": "^8",
51+
"eslint-config-next": "14.1.4",
52+
"less": "^4.2.0",
53+
"postcss": "^8",
54+
"prettier": "^3.2.5",
55+
"tailwindcss": "^3.4.3",
56+
"typescript": "^5",
57+
"vite": "^2.9.7"
5058
}
5159
}

media/postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

media/src/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
15
.pontx-page .next-icon {
26
font-family: NextIcon !important;
37
}

media/tailwind.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { Config } from "tailwindcss";
2+
3+
const config: Config = {
4+
content: [
5+
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
6+
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
7+
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
8+
],
9+
theme: {
10+
extend: {
11+
backgroundImage: {
12+
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
13+
"gradient-conic":
14+
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
15+
},
16+
},
17+
},
18+
plugins: [],
19+
};
20+
export default config;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@
263263
"@types/vscode-webview": "^1.57.0",
264264
"@vercel/ncc": "^0.38.1",
265265
"@vitejs/plugin-react": "^1.3.2",
266-
"prettier": "*",
266+
"prettier": "^3.2.5",
267+
"prettier-plugin-tailwindcss": "^0.5.13",
267268
"rimraf": "^3.0.2",
268269
"typescript": "^5.2.2",
269270
"vite": "^2.9.7",

0 commit comments

Comments
 (0)