Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
risk-monitor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡建
risk-monitor
Commits
1fdae7fb
提交
1fdae7fb
authored
3月 06, 2026
作者:
朱政
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:完善开发样式组件颜色部分
上级
10eacdc2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
65 行增加
和
10 行删除
+65
-10
constStyle.vue
src/components/devStyle/components/constStyle.vue
+51
-8
main.css
src/styles/main.css
+14
-2
没有找到文件。
src/components/devStyle/components/constStyle.vue
浏览文件 @
1fdae7fb
...
...
@@ -3,7 +3,9 @@ import { ElSpace, ElButton } from 'element-plus';
import
"@/styles/main.css"
import
{
copyToClipboardThenTip
}
from
'@/utils/systemUtils'
const
colors
=
[
// 黑色到白色主色一行
const
rowBlackToWhite
=
[
{
title
:
"黑色"
,
name
:
"--text-primary-color"
},
{
title
:
"黑色90% / 主标题文字颜色"
,
name
:
"--text-primary-90-color"
},
{
title
:
"黑色80% / 小标题文字颜色"
,
name
:
"--text-primary-80-color"
},
{
title
:
"黑色65% / 正文颜色"
,
name
:
"--text-primary-65-color"
},
...
...
@@ -12,7 +14,25 @@ const colors = [
{
title
:
"黑色5% / 分割线颜色"
,
name
:
"--bg-black-5"
},
{
title
:
"黑色2% / 灰色背景色"
,
name
:
"--bg-black-2"
},
{
title
:
"白色主色"
,
name
:
"--bg-white-100"
},
]
// 主色到主色高亮背景一行(主色高亮背景为浅色,需黑色文字)
const
rowPrimaryToHighlight
=
[
{
title
:
"主色"
,
name
:
"--color-primary-100"
},
{
title
:
"主色50%"
,
name
:
"--color-primary-50"
,
light
:
true
},
{
title
:
"主色35%"
,
name
:
"--color-primary-35"
},
{
title
:
"主色10%"
,
name
:
"--color-primary-10"
,
light
:
true
},
{
title
:
"主色高亮背景"
,
name
:
"--color-primary-2"
,
light
:
true
},
]
// 红色到绿色10%一行(*10% 为浅色背景,需黑色文字)
const
rowRedToGreen10
=
[
{
title
:
"红色"
,
name
:
"--color-red-100"
},
{
title
:
"红色10%"
,
name
:
"--color-red-10"
,
light
:
true
},
{
title
:
"橙色"
,
name
:
"--color-orange-100"
},
{
title
:
"橙色10%"
,
name
:
"--color-orange-10"
,
light
:
true
},
{
title
:
"黄色"
,
name
:
"--color-yellow-100"
},
{
title
:
"黄色10%"
,
name
:
"--color-yellow-10"
,
light
:
true
},
{
title
:
"绿色"
,
name
:
"--color-green-100"
},
{
title
:
"绿色10%"
,
name
:
"--color-green-10"
,
light
:
true
},
]
function
copyColorVar
(
item
)
{
const
color
=
`var(
${
item
.
name
}
)`
...
...
@@ -23,13 +43,36 @@ function copyColorVar(item) {
<
template
>
<el-space
direction=
"vertical"
alignment=
"flex-start"
>
<div
class=
"text-title-2"
>
颜色
</div>
<el-space>
<el-button
v-for=
"(item, index) in colors"
:key=
"index"
:color=
"`var($
{item.name})`"
v-on:click="copyColorVar(item)">
{{
item
.
title
}}
</el-button>
<el-space
direction=
"vertical"
alignment=
"flex-start"
>
<el-space
wrap
>
<el-button
v-for=
"(item, index) in rowBlackToWhite"
:key=
"'bw-' + index"
:color=
"`var($
{item.name})`"
@click="copyColorVar(item)">
{{
item
.
title
}}
</el-button>
</el-space>
<el-space
wrap
>
<el-button
v-for=
"(item, index) in rowPrimaryToHighlight"
:key=
"'ph-' + index"
:class=
"
{ 'color-btn-text-black': item.light }"
:style="item.light ? { '--btn-bg': `var(${item.name})` } : undefined" :color="`var(${item.name})`"
@click="copyColorVar(item)">
{{
item
.
title
}}
</el-button>
</el-space>
<el-space
wrap
>
<el-button
v-for=
"(item, index) in rowRedToGreen10"
:key=
"'rg-' + index"
:class=
"
{ 'color-btn-text-black': item.light }"
:style="item.light ? { '--btn-bg': `var(${item.name})` } : undefined" :color="`var(${item.name})`"
@click="copyColorVar(item)">
{{
item
.
title
}}
</el-button>
</el-space>
</el-space>
</el-space>
</
template
>
<
style
scoped
></
style
>
\ No newline at end of file
<
style
scoped
>
/* 浅色背景按钮:文字黑色 */
:deep
(
.color-btn-text-black
)
{
color
:
var
(
--el-color-black
)
!important
;
}
</
style
>
\ No newline at end of file
src/styles/main.css
浏览文件 @
1fdae7fb
...
...
@@ -39,10 +39,22 @@
/* 主色 设计定义*/
--color-primary-100
:
#055FC2
;
--color-primary-50
:
#8
2AFE0
;
--color-primary-35
:
#
AED6
FF
;
--color-primary-50
:
#8
9C1FF
;
--color-primary-35
:
#
B9DC
FF
;
--color-primary-10
:
#E7F3FF
;
--color-primary-2
:
#F6FAFF
;
/* 红色 设计定义 */
--color-red-100
:
#CE4F51
;
--color-red-10
:
rgba
(
206
,
79
,
81
,
0.1
);
/* 橙色 设计定义 */
--color-orange-100
:
#FF954D
;
--color-orange-10
:
rgba
(
255
,
149
,
77
,
0.1
);
/* 黄色 设计定义 */
--color-yellow-100
:
#E8BD0B
;
--color-yellow-10
:
rgba
(
232
,
189
,
11
,
0.1
);
/* 绿色 设计定义 */
--color-green-100
:
#218139
;
--color-green-10
:
rgba
(
33
,
129
,
57
,
0.1
);
}
.hover-dialog
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论