Skip to content

Commit 405aeec

Browse files
author
chenghao
committed
add antd theme config
1 parent bfb2308 commit 405aeec

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

config/webpack.config.dev.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const eslintFormatter = require('react-dev-utils/eslintFormatter');
1111
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
1212
const getClientEnvironment = require('./env');
1313
const paths = require('./paths');
14+
const theme = require('../theme');
1415

1516
// Webpack uses `publicPath` to determine where the app is being served from.
1617
// In development, we always serve from the root. This makes config easier.
@@ -215,7 +216,7 @@ module.exports = {
215216
{
216217
loader: require.resolve('less-loader'),
217218
options: {
218-
modifyVars: { "@primary-color": "#001529" },
219+
modifyVars: theme,
219220
},
220221
},
221222
],

config/webpack.config.prod.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const eslintFormatter = require('react-dev-utils/eslintFormatter');
1212
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
1313
const paths = require('./paths');
1414
const getClientEnvironment = require('./env');
15+
const theme = require('../theme');
1516

1617
// Webpack uses `publicPath` to determine where the app is being served from.
1718
// It requires a trailing slash, or the file assets will get an incorrect path.
@@ -215,7 +216,7 @@ module.exports = {
215216
{
216217
loader: require.resolve('less-loader'),
217218
options: {
218-
modifyVars: { "@primary-color": "#001529" },
219+
modifyVars: theme,
219220
},
220221
},
221222
],

src/style/index.less

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
}
6161

6262
:global {
63-
.ant-menu-vertical .ant-menu-item, .ant-menu-vertical-left .ant-menu-item, .ant-menu-vertical-right .ant-menu-item, .ant-menu-inline .ant-menu-item, .ant-menu-vertical .ant-menu-submenu-title, .ant-menu-vertical-left .ant-menu-submenu-title, .ant-menu-vertical-right .ant-menu-submenu-title, .ant-menu-inline .ant-menu-submenu-title{
64-
font-size: 12px !important;
65-
}
6663
.ant-card-head-title {
6764
font-size: 14px !important;
6865
}

theme/index.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"@primary-color": "#001529",
3+
"@font-size-base": "12px"
4+
}

0 commit comments

Comments
 (0)