Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
600332e6
Commit
600332e6
authored
Jun 02, 2019
by
huangzheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lint
parent
281200c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
config/plugin.config.ts
config/plugin.config.ts
+6
-4
src/models/setting.ts
src/models/setting.ts
+5
-3
No files found.
config/plugin.config.ts
View file @
600332e6
...
@@ -46,7 +46,7 @@ export default (config: any) => {
...
@@ -46,7 +46,7 @@ export default (config: any) => {
fileName
:
'
css/theme-colors.css
'
,
fileName
:
'
css/theme-colors.css
'
,
matchColors
:
getAntdSerials
(
'
#1890ff
'
),
// 主色系列
matchColors
:
getAntdSerials
(
'
#1890ff
'
),
// 主色系列
// 改变样式选择器,解决样式覆盖问题
// 改变样式选择器,解决样式覆盖问题
changeSelector
(
selector
)
{
changeSelector
(
selector
:
string
)
{
switch
(
selector
)
{
switch
(
selector
)
{
case
'
.ant-calendar-today .ant-calendar-date
'
:
case
'
.ant-calendar-today .ant-calendar-date
'
:
return
'
:not(.ant-calendar-selected-date)
'
+
selector
;
return
'
:not(.ant-calendar-selected-date)
'
+
selector
;
...
@@ -103,10 +103,12 @@ export default (config: any) => {
...
@@ -103,10 +103,12 @@ export default (config: any) => {
});
});
};
};
function
getAntdSerials
(
color
)
{
const
getAntdSerials
=
(
color
:
string
)
=>
{
const
lightNum
=
9
;
const
devide10
=
10
;
// 淡化(即less的tint)
// 淡化(即less的tint)
const
lightens
=
new
Array
(
9
).
fill
().
map
((
t
,
i
)
=>
{
const
lightens
=
new
Array
(
lightNum
).
fill
().
map
((
t
,
i
)
=>
{
return
ThemeColorReplacer
.
varyColor
.
lighten
(
color
,
i
/
10
);
return
ThemeColorReplacer
.
varyColor
.
lighten
(
color
,
i
/
devide
10
);
});
});
const
colorPalettes
=
generate
(
color
);
const
colorPalettes
=
generate
(
color
);
return
lightens
.
concat
(
colorPalettes
);
return
lightens
.
concat
(
colorPalettes
);
...
...
src/models/setting.ts
View file @
600332e6
...
@@ -12,9 +12,11 @@ export interface SettingModelType {
...
@@ -12,9 +12,11 @@ export interface SettingModelType {
};
};
}
}
const
updateTheme
=
(
newPrimaryColor
:
string
)
=>
{
const
updateTheme
=
(
newPrimaryColor
?:
string
)
=>
{
const
hideMessage
=
message
.
loading
(
'
正在切换主题!
'
,
0
);
const
timeOut
=
0
;
themeColorClient
.
changeColor
(
newPrimaryColor
).
finally
(()
=>
hideMessage
());
const
hideMessage
=
message
.
loading
(
'
正在切换主题!
'
,
timeOut
);
themeColorClient
.
changeColor
(
newPrimaryColor
)
.
finally
(()
=>
hideMessage
());
};
};
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment