Skip to content

Commit

Permalink
feat: tailwindcss
Browse files Browse the repository at this point in the history
  • Loading branch information
npv2k1 committed Aug 5, 2024
1 parent 2d28996 commit df2fa98
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 57 deletions.
3 changes: 2 additions & 1 deletion config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default defineConfig({
*/
locale: {
// default zh-CN
default: 'zh-CN',
default: 'en-US',
antd: true,
// default true, when it is true, will use `navigator.language` overwrite default
baseNavigator: true,
Expand Down Expand Up @@ -153,4 +153,5 @@ export default defineConfig({
},
esbuildMinifyIIFE: true,
requestRecord: {},
extraPostCSSPlugins: [require('tailwindcss')],
});
17 changes: 14 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
"**/*.{js,jsx,tsx,ts,less,md,json}": ["prettier --write"]
"**/*.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write"
]
},
"browserslist": ["> 1%", "last 2 versions", "not ie <= 10"],
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 10"
],
"dependencies": {
"@ant-design/icons": "^4.8.1",
"@ant-design/pro-components": "^2.6.48",
Expand Down Expand Up @@ -68,6 +74,7 @@
"@umijs/fabric": "^2.14.1",
"@umijs/lint": "^4.1.1",
"@umijs/max": "^4.1.1",
"autoprefixer": "^10.4.20",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"express": "^4.18.2",
Expand All @@ -77,13 +84,17 @@
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^10.5.4",
"mockjs": "^1.1.0",
"postcss": "^8.4.40",
"prettier": "^2.8.8",
"react-dev-inspector": "^1.9.0",
"swagger-ui-dist": "^4.19.1",
"tailwindcss": "^3.4.7",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"umi-presets-pro": "^2.0.3",
"umi-serve": "^1.9.11"
},
"engines": { "node": ">=12.0.0" }
"engines": {
"node": ">=12.0.0"
}
}
54 changes: 1 addition & 53 deletions src/global.less
Original file line number Diff line number Diff line change
@@ -1,53 +1 @@
html,
body,
#root {
height: 100%;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';
}

.colorWeak {
filter: invert(80%);
}

.ant-layout {
min-height: 100vh;
}
.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed {
left: unset;
}

canvas {
display: block;
}

body {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

ul,
ol {
list-style: none;
}

@media (max-width: 768px) {
.ant-table {
width: 100%;
overflow-x: auto;
&-thead > tr,
&-tbody > tr {
> th,
> td {
white-space: pre;
> span {
display: block;
}
}
}
}
}
@import './styles/index.less';
1 change: 1 addition & 0 deletions src/styles/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import './tailwind.css';
3 changes: 3 additions & 0 deletions src/styles/tailwind.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
9 changes: 9 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{js,ts,jsx,tsx,mdx}'],

theme: {
extend: {},
},
plugins: [],
};

0 comments on commit df2fa98

Please sign in to comment.