-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
feat: real dark #4356
feat: real dark #4356
Changes from all commits
9389e78
4236906
157a5ba
d61b6ed
bd4510a
431d119
c825025
638ffca
074ad44
18fd512
461d425
3cc5782
5a06f95
bf61eb0
75772af
a635f56
646b2b6
2bfb704
755008c
5d5c4bb
c2f4365
8513207
633c3c5
fa54bc9
8cb1a82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import { IConfig, IPlugin } from 'umi-types'; | ||
import defaultSettings from './defaultSettings'; // https://umijs.org/config/ | ||
|
||
import slash from 'slash2'; | ||
import webpackPlugin from './plugin.config'; | ||
import themePluginConfig from './themePluginConfig'; | ||
|
||
// import darkTheme from '@ant-design/dark-theme'; | ||
|
||
const { pwa, primaryColor } = defaultSettings; | ||
|
||
// preview.pro.ant.design only do not use in your production ; | ||
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 | ||
const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env; | ||
const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION, TEST } = process.env; | ||
const isAntDesignProPreview = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site'; | ||
|
||
const plugins: IPlugin[] = [ | ||
[ | ||
'umi-plugin-react', | ||
|
@@ -37,8 +40,7 @@ const plugins: IPlugin[] = [ | |
importWorkboxFrom: 'local', | ||
}, | ||
} | ||
: false, | ||
// default close dll, because issue https://github.com/ant-design/ant-design-pro/issues/4665 | ||
: false, // default close dll, because issue https://github.com/ant-design/ant-design-pro/issues/4665 | ||
// dll features https://webpack.js.org/plugins/dll-plugin/ | ||
// dll: { | ||
// include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'], | ||
|
@@ -55,15 +57,55 @@ const plugins: IPlugin[] = [ | |
autoAddMenu: true, | ||
}, | ||
], | ||
]; // 针对 preview.pro.ant.design 的 GA 统计代码 | ||
]; | ||
|
||
if (isAntDesignProPreview) { | ||
// 针对 preview.pro.ant.design 的 GA 统计代码 | ||
plugins.push([ | ||
'umi-plugin-ga', | ||
{ | ||
code: 'UA-72788897-6', | ||
}, | ||
]); | ||
plugins.push(['umi-plugin-antd-theme', themePluginConfig]); | ||
} | ||
|
||
if (!TEST) { | ||
plugins.push([ | ||
'umi-plugin-antd-theme', | ||
{ | ||
theme: [ | ||
{ | ||
key: 'dark', | ||
fileName: 'dark.css', | ||
theme: 'dark', | ||
}, | ||
{ | ||
key: 'dust', | ||
fileName: 'dust.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#F5222D', | ||
}, | ||
}, | ||
{ | ||
key: 'dust', | ||
theme: 'dark', | ||
fileName: 'dark-dust.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#F5222D', | ||
}, | ||
}, | ||
{ | ||
key: 'volcano', | ||
theme: 'dark', | ||
fileName: 'dark-volcano.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#FA541C', | ||
}, | ||
}, | ||
], | ||
}, | ||
]); | ||
} | ||
|
||
export default { | ||
|
@@ -134,6 +176,7 @@ export default { | |
], | ||
// Theme for antd: https://ant.design/docs/react/customize-theme-cn | ||
theme: { | ||
// ...darkTheme, | ||
'primary-color': primaryColor, | ||
}, | ||
define: { | ||
|
@@ -179,14 +222,12 @@ export default { | |
manifest: { | ||
basePath: '/', | ||
}, | ||
chainWebpack: webpackPlugin, | ||
/* | ||
proxy: { | ||
'/server/api/': { | ||
target: 'https://preview.pro.ant.design/', | ||
changeOrigin: true, | ||
pathRewrite: { '^/server': '' }, | ||
}, | ||
}, | ||
*/ | ||
// chainWebpack: webpackPlugin, | ||
// proxy: { | ||
// '/server/api/': { | ||
// target: 'https://preview.pro.ant.design/', | ||
// changeOrigin: true, | ||
// pathRewrite: { '^/server': '' }, | ||
// }, | ||
// }, | ||
} as IConfig; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
export default { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
theme: [ | ||
{ | ||
key: 'dark', | ||
fileName: 'dark.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
theme: 'dark', | ||
}, | ||
{ | ||
key: 'dust', | ||
fileName: 'dust.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#F5222D', | ||
}, | ||
}, | ||
{ | ||
key: 'volcano', | ||
fileName: 'volcano.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#FA541C', | ||
}, | ||
}, | ||
{ | ||
key: 'sunset', | ||
fileName: 'sunset.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#FAAD14', | ||
}, | ||
}, | ||
{ | ||
key: 'cyan', | ||
fileName: 'cyan.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#13C2C2', | ||
}, | ||
}, | ||
{ | ||
key: 'green', | ||
fileName: 'green.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#52C41A', | ||
}, | ||
}, | ||
{ | ||
key: 'geekblue', | ||
fileName: 'geekblue.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#2F54EB', | ||
}, | ||
}, | ||
{ | ||
key: 'purple', | ||
fileName: 'purple.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#722ED1', | ||
}, | ||
}, | ||
|
||
{ | ||
key: 'dust', | ||
theme: 'dark', | ||
fileName: 'dark-dust.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#F5222D', | ||
}, | ||
}, | ||
{ | ||
key: 'volcano', | ||
theme: 'dark', | ||
fileName: 'dark-volcano.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#FA541C', | ||
}, | ||
}, | ||
{ | ||
key: 'sunset', | ||
theme: 'dark', | ||
fileName: 'dark-sunset.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#FAAD14', | ||
}, | ||
}, | ||
{ | ||
key: 'cyan', | ||
theme: 'dark', | ||
fileName: 'dark-cyan.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#13C2C2', | ||
}, | ||
}, | ||
{ | ||
key: 'green', | ||
theme: 'dark', | ||
fileName: 'dark-green.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#52C41A', | ||
}, | ||
}, | ||
{ | ||
key: 'geekblue', | ||
theme: 'dark', | ||
fileName: 'dark-geekblue.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#2F54EB', | ||
}, | ||
}, | ||
{ | ||
key: 'purple', | ||
theme: 'dark', | ||
fileName: 'dark-purple.css', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
modifyVars: { | ||
'@primary-color': '#722ED1', | ||
}, | ||
}, | ||
], | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.