xt-element-ui 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.common.js +715 -396
- package/lib/index.css +1 -1
- package/lib/index.umd.js +715 -396
- package/lib/index.umd.min.js +1 -1
- package/package.json +2 -2
- package/src/components/button/index.vue +54 -15
- package/src/components/button/style/index copy.scss +221 -0
- package/src/components/button/style/index.scss +136 -0
- package/src/components/card/index.vue +20 -41
- package/src/components/card/style/index.scss +49 -0
- package/src/components/card-item/index.vue +71 -90
- package/src/components/card-item/style/index.scss +72 -0
- package/src/components/config-provider/index.js +2 -0
- package/src/components/config-provider/index.vue +193 -0
- package/src/components/config-provider/style/index.scss +12 -0
- package/src/components/flex-box/index.vue +20 -90
- package/src/components/flex-box/style/index.scss +91 -0
- package/src/components/index.scss +22 -0
- package/src/components/input/index.vue +28 -11
- package/src/components/input/style/index.scss +27 -0
- package/src/components/text/index.js +2 -0
- package/src/components/text/index.vue +42 -0
- package/src/components/text/style/index.scss +45 -0
- package/src/index.js +69 -123
- package/src/styles/{theme.scss → css-variables.scss} +72 -31
- package/src/styles/{theme-element.scss → element-theme.scss} +0 -10
- package/src/styles/theme/background.scss +6 -0
- package/src/styles/theme/border-radius.scss +4 -0
- package/src/styles/theme/borders.scss +4 -0
- package/src/styles/theme/colors.scss +11 -0
- package/src/styles/theme/component-variables.scss +70 -0
- package/src/styles/theme/dark-variables.scss +29 -0
- package/src/styles/theme/font.scss +10 -0
- package/src/styles/theme/index.scss +11 -0
- package/src/styles/theme/shadows.scss +3 -0
- package/src/styles/theme/spacing.scss +5 -0
- package/src/styles/theme/transitions.scss +3 -0
- package/src/styles/theme/typography.scss +5 -0
- package/src/styles/{export.scss → variables-export.scss} +1 -1
- package/src/styles/variables.scss +1 -126
- package/src/utils/index.js +193 -124
|
@@ -1,20 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<div class="xt-input">
|
|
2
3
|
<el-input
|
|
3
4
|
:value="value"
|
|
4
5
|
:placeholder="placeholder"
|
|
6
|
+
:style="inputStyle"
|
|
5
7
|
@input="$emit('input', $event)"
|
|
6
8
|
/>
|
|
7
|
-
</
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
name: 'XtInput',
|
|
15
|
+
props: {
|
|
16
|
+
value: [String, Number],
|
|
17
|
+
placeholder: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '请输入内容'
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ''
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
computed: {
|
|
27
|
+
inputStyle() {
|
|
28
|
+
if (this.color) {
|
|
29
|
+
return {
|
|
30
|
+
'--xt-input-focus-color': this.color
|
|
31
|
+
}
|
|
17
32
|
}
|
|
33
|
+
return {}
|
|
18
34
|
}
|
|
19
35
|
}
|
|
20
|
-
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import '../../../styles/variables.scss';
|
|
2
|
+
|
|
3
|
+
.xt-input .el-input__inner {
|
|
4
|
+
--xt-input-focus-color: var(--xt-color-primary, #1890ff);
|
|
5
|
+
|
|
6
|
+
background-color: var(--xt-input-bg-color, #ffffff);
|
|
7
|
+
border-color: var(--xt-input-border-color, #DCDFE6);
|
|
8
|
+
color: var(--xt-input-text-color, #303133);
|
|
9
|
+
font-size: var(--xt-font-size-base, 14px);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.xt-input .el-input__inner::placeholder {
|
|
13
|
+
color: var(--xt-input-placeholder-color, #C0C4CC);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.xt-input .el-input__inner:focus {
|
|
17
|
+
border-color: var(--xt-input-focus-color);
|
|
18
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--xt-input-focus-color) 20%, transparent);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.xt-input .el-input {
|
|
22
|
+
height: var(--xt-input-height, 32px);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.xt-input .el-input .el-input__wrapper {
|
|
26
|
+
padding: 0 var(--xt-input-padding-x, 15px);
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
class="xt-text"
|
|
4
|
+
:class="[
|
|
5
|
+
type ? 'xt-text--' + type : '',
|
|
6
|
+
{ 'xt-text--bold': bold }
|
|
7
|
+
]"
|
|
8
|
+
:style="customStyle"
|
|
9
|
+
>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</span>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'XtText',
|
|
17
|
+
props: {
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '',
|
|
21
|
+
validator: (val) => ['', 'primary', 'success', 'warning', 'danger'].includes(val)
|
|
22
|
+
},
|
|
23
|
+
bold: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
letterSpacing: {
|
|
28
|
+
type: [String, Number],
|
|
29
|
+
default: ''
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
computed: {
|
|
33
|
+
customStyle() {
|
|
34
|
+
const style = {}
|
|
35
|
+
if (this.letterSpacing) {
|
|
36
|
+
style.letterSpacing = typeof this.letterSpacing === 'number' ? `${this.letterSpacing}px` : this.letterSpacing
|
|
37
|
+
}
|
|
38
|
+
return style
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@import '../../../styles/variables.scss';
|
|
2
|
+
|
|
3
|
+
// 文字组件
|
|
4
|
+
.xt-text {
|
|
5
|
+
letter-spacing: $xt-spacing-xs;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// 不同类型文字颜色
|
|
9
|
+
.xt-text--primary {
|
|
10
|
+
color: $xt-color-primary;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.xt-text--success {
|
|
14
|
+
color: $xt-color-success;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.xt-text--warning {
|
|
18
|
+
color: $xt-color-warning;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.xt-text--danger {
|
|
22
|
+
color: $xt-color-danger;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 粗体
|
|
26
|
+
.xt-text--bold {
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 暗色主题
|
|
31
|
+
html.dark .xt-text--primary {
|
|
32
|
+
color: $xt-color-primary;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
html.dark .xt-text--success {
|
|
36
|
+
color: $xt-dark-color-success;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
html.dark .xt-text--warning {
|
|
40
|
+
color: $xt-dark-color-warning;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
html.dark .xt-text--danger {
|
|
44
|
+
color: $xt-dark-color-danger;
|
|
45
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
// 导入主题样式(定义 CSS 变量)
|
|
2
|
+
import './styles/css-variables.scss'
|
|
3
|
+
|
|
4
|
+
// 导入组件样式(统一入口)
|
|
5
|
+
import './components/index.scss'
|
|
6
|
+
|
|
1
7
|
// 导入 SCSS 变量(通过 CSS Modules :export 导出)
|
|
2
|
-
import variables from './styles/export.scss'
|
|
8
|
+
import variables from './styles/variables-export.scss'
|
|
9
|
+
|
|
10
|
+
import utilsModule from './utils/index'
|
|
11
|
+
|
|
12
|
+
// ES Module 默认导出需要通过 .default 访问
|
|
13
|
+
const utils = utilsModule.default || utilsModule
|
|
3
14
|
|
|
4
|
-
|
|
15
|
+
// 从 utils 导入配置管理函数(仅用于存储配置)
|
|
16
|
+
const { getConfig, setConfig, getTheme, getSize, getPrimaryColor, resetConfig, onConfigChange, setTheme, setSize, setPrimaryColor } = utils
|
|
5
17
|
|
|
6
18
|
// 导入组件
|
|
7
19
|
import Button from './components/button'
|
|
@@ -9,6 +21,8 @@ import Input from './components/input'
|
|
|
9
21
|
import FlexBox from './components/flex-box'
|
|
10
22
|
import Card from './components/card'
|
|
11
23
|
import CardItem from './components/card-item'
|
|
24
|
+
import ConfigProvider from './components/config-provider'
|
|
25
|
+
import Text from './components/text'
|
|
12
26
|
|
|
13
27
|
// 存储组件列表
|
|
14
28
|
const components = [
|
|
@@ -16,12 +30,14 @@ const components = [
|
|
|
16
30
|
Input,
|
|
17
31
|
FlexBox,
|
|
18
32
|
Card,
|
|
19
|
-
CardItem
|
|
33
|
+
CardItem,
|
|
34
|
+
ConfigProvider,
|
|
35
|
+
Text
|
|
20
36
|
]
|
|
21
37
|
|
|
22
38
|
|
|
23
39
|
// 定义 install 方法,Vue.use() 会自动调用
|
|
24
|
-
const install = function (Vue) {
|
|
40
|
+
const install = function (Vue, options = {}) {
|
|
25
41
|
if (install.installed) return
|
|
26
42
|
install.installed = true
|
|
27
43
|
|
|
@@ -29,7 +45,40 @@ const install = function (Vue) {
|
|
|
29
45
|
components.forEach(component => {
|
|
30
46
|
Vue.component(component.name, component)
|
|
31
47
|
})
|
|
32
|
-
|
|
48
|
+
|
|
49
|
+
// 将工具方法挂载到 Vue.prototype
|
|
50
|
+
Vue.prototype.$xt = {
|
|
51
|
+
setTheme,
|
|
52
|
+
setSize,
|
|
53
|
+
setPrimaryColor,
|
|
54
|
+
getConfig,
|
|
55
|
+
setConfig,
|
|
56
|
+
getTheme,
|
|
57
|
+
getSize,
|
|
58
|
+
getPrimaryColor,
|
|
59
|
+
resetConfig,
|
|
60
|
+
onConfigChange
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 在安装时直接应用配置选项
|
|
64
|
+
if (options) {
|
|
65
|
+
// 处理主题配置
|
|
66
|
+
if (options.theme !== undefined) {
|
|
67
|
+
setTheme(options.theme)
|
|
68
|
+
}
|
|
69
|
+
// 处理字体大小配置
|
|
70
|
+
if (options.size !== undefined) {
|
|
71
|
+
setSize(options.size)
|
|
72
|
+
}
|
|
73
|
+
// 处理主色调配置
|
|
74
|
+
if (options.primaryColor !== undefined) {
|
|
75
|
+
setPrimaryColor(options.primaryColor)
|
|
76
|
+
}
|
|
77
|
+
// 处理完整配置对象
|
|
78
|
+
if (options.config !== undefined) {
|
|
79
|
+
setConfig(options.config)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
33
82
|
}
|
|
34
83
|
|
|
35
84
|
// 支持全局 script 标签引入
|
|
@@ -45,127 +94,24 @@ export default {
|
|
|
45
94
|
Input,
|
|
46
95
|
FlexBox,
|
|
47
96
|
Card,
|
|
48
|
-
CardItem
|
|
97
|
+
CardItem,
|
|
98
|
+
ConfigProvider,
|
|
99
|
+
Text
|
|
49
100
|
}
|
|
50
101
|
|
|
51
102
|
// 导出工具函数和变量
|
|
52
103
|
export {
|
|
53
104
|
utils,
|
|
54
|
-
variables
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
105
|
+
variables,
|
|
106
|
+
// 配置管理函数(从 utils 导入)
|
|
107
|
+
getConfig,
|
|
108
|
+
setConfig,
|
|
109
|
+
getTheme,
|
|
110
|
+
getSize,
|
|
111
|
+
getPrimaryColor,
|
|
112
|
+
resetConfig,
|
|
113
|
+
onConfigChange,
|
|
114
|
+
setTheme,
|
|
115
|
+
setSize,
|
|
116
|
+
setPrimaryColor
|
|
62
117
|
}
|
|
63
|
-
|
|
64
|
-
// 当前配置
|
|
65
|
-
let currentConfig = { ...defaultConfig }
|
|
66
|
-
|
|
67
|
-
// 配置变更事件处理
|
|
68
|
-
const configChangeListeners = []
|
|
69
|
-
|
|
70
|
-
const emitConfigChange = function(key, value) {
|
|
71
|
-
configChangeListeners.forEach(listener => {
|
|
72
|
-
listener(key, value)
|
|
73
|
-
})
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// 获取所有配置
|
|
77
|
-
export const getConfig = function() {
|
|
78
|
-
return { ...currentConfig }
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// 设置全局配置
|
|
82
|
-
export const setConfig = function(config) {
|
|
83
|
-
if (typeof config !== 'object' || config === null) {
|
|
84
|
-
console.warn('[XtElementUI] setConfig 必须传入对象参数')
|
|
85
|
-
return
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (config.theme !== undefined) {
|
|
89
|
-
setTheme(config.theme)
|
|
90
|
-
}
|
|
91
|
-
if (config.size !== undefined) {
|
|
92
|
-
setSize(config.size)
|
|
93
|
-
}
|
|
94
|
-
if (config.primaryColor !== undefined) {
|
|
95
|
-
setPrimaryColor(config.primaryColor)
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// 设置主题(只控制颜色)
|
|
100
|
-
export const setTheme = function(theme) {
|
|
101
|
-
const validThemes = ['light', 'dark']
|
|
102
|
-
if (!validThemes.includes(theme)) {
|
|
103
|
-
console.warn(`[XtElementUI] 无效的主题值: ${theme},可选值: ${validThemes.join(', ')}`)
|
|
104
|
-
return
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
currentConfig.theme = theme
|
|
108
|
-
document.documentElement.setAttribute('data-theme', theme)
|
|
109
|
-
emitConfigChange('theme', theme)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// 设置字体大小和间距
|
|
113
|
-
export const setSize = function(size) {
|
|
114
|
-
const validSizes = ['small', 'medium', 'large']
|
|
115
|
-
if (!validSizes.includes(size)) {
|
|
116
|
-
console.warn(`[XtElementUI] 无效的大小值: ${size},可选值: ${validSizes.join(', ')}`)
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
currentConfig.size = size
|
|
121
|
-
document.documentElement.setAttribute('data-size', size)
|
|
122
|
-
emitConfigChange('size', size)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// 设置主色调
|
|
126
|
-
export const setPrimaryColor = function(color) {
|
|
127
|
-
const colorRegex = /^#[0-9A-Fa-f]{6}$|^#[0-9A-Fa-f]{3}$/
|
|
128
|
-
if (!colorRegex.test(color)) {
|
|
129
|
-
console.warn(`[XtElementUI] 无效的颜色值: ${color},请使用十六进制颜色格式,如 #1890ff`)
|
|
130
|
-
return
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
currentConfig.primaryColor = color
|
|
134
|
-
document.documentElement.style.setProperty('--xt-color-primary', color)
|
|
135
|
-
emitConfigChange('primaryColor', color)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// 获取当前主题
|
|
139
|
-
export const getTheme = function() {
|
|
140
|
-
return currentConfig.theme
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// 获取当前字体大小
|
|
144
|
-
export const getSize = function() {
|
|
145
|
-
return currentConfig.size
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// 获取当前主色调
|
|
149
|
-
export const getPrimaryColor = function() {
|
|
150
|
-
return currentConfig.primaryColor
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// 重置为默认配置
|
|
154
|
-
export const resetConfig = function() {
|
|
155
|
-
setConfig(defaultConfig)
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// 监听配置变更
|
|
159
|
-
export const onConfigChange = function(listener) {
|
|
160
|
-
if (typeof listener === 'function') {
|
|
161
|
-
configChangeListeners.push(listener)
|
|
162
|
-
return function() {
|
|
163
|
-
const index = configChangeListeners.indexOf(listener)
|
|
164
|
-
if (index > -1) {
|
|
165
|
-
configChangeListeners.splice(index, 1)
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
} else {
|
|
169
|
-
console.warn('[XtElementUI] onConfigChange 必须传入函数')
|
|
170
|
-
}
|
|
171
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@
|
|
1
|
+
@import './theme/index.scss';
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
4
|
// 主色调系列
|
|
@@ -64,39 +64,82 @@
|
|
|
64
64
|
// 过渡动画
|
|
65
65
|
--xt-transition-duration: #{$xt-transition-duration};
|
|
66
66
|
--xt-transition-duration-fast: #{$xt-transition-duration-fast};
|
|
67
|
+
|
|
68
|
+
// 按钮专用变量
|
|
69
|
+
--xt-button-height: #{$xt-button-height};
|
|
70
|
+
--xt-button-padding-x: #{$xt-button-padding-x};
|
|
71
|
+
--xt-button-padding-y: #{$xt-button-padding-y};
|
|
72
|
+
--xt-button-font-weight: #{$xt-button-font-weight};
|
|
73
|
+
--xt-button-border-width: #{$xt-button-border-width};
|
|
74
|
+
--xt-button-transition: #{$xt-button-transition};
|
|
75
|
+
|
|
76
|
+
// 卡片专用变量
|
|
77
|
+
--xt-card-bg-color: #{$xt-card-bg-color};
|
|
78
|
+
--xt-card-border-color: #{$xt-card-border-color};
|
|
79
|
+
--xt-card-border-radius: #{$xt-card-border-radius};
|
|
80
|
+
--xt-card-padding: #{$xt-card-padding};
|
|
81
|
+
--xt-card-header-padding: #{$xt-card-header-padding};
|
|
82
|
+
--xt-card-shadow: #{$xt-card-shadow};
|
|
83
|
+
|
|
84
|
+
// 卡片项专用变量
|
|
85
|
+
--xt-card-item-min-height: #{$xt-card-item-min-height};
|
|
86
|
+
--xt-card-item-gap: #{$xt-card-item-gap};
|
|
87
|
+
--xt-card-item-border-width: #{$xt-card-item-border-width};
|
|
88
|
+
|
|
89
|
+
// 输入框专用变量
|
|
90
|
+
--xt-input-height: #{$xt-input-height};
|
|
91
|
+
--xt-input-padding-x: #{$xt-input-padding-x};
|
|
92
|
+
--xt-input-bg-color: #{$xt-input-bg-color};
|
|
93
|
+
--xt-input-border-color: #{$xt-input-border-color};
|
|
94
|
+
--xt-input-text-color: #{$xt-input-text-color};
|
|
95
|
+
--xt-input-placeholder-color: #{$xt-input-placeholder-color};
|
|
96
|
+
|
|
97
|
+
// FlexBox 专用变量
|
|
98
|
+
--xt-flex-box-gap: #{$xt-flex-box-gap};
|
|
67
99
|
}
|
|
68
100
|
|
|
69
|
-
// 暗色主题
|
|
70
|
-
[data-theme="dark"] {
|
|
71
|
-
--xt-color-primary:
|
|
72
|
-
--xt-color-success: #
|
|
73
|
-
--xt-color-warning: #
|
|
74
|
-
--xt-color-danger: #
|
|
75
|
-
--xt-color-info: #
|
|
76
|
-
|
|
77
|
-
--xt-color-text-primary:
|
|
78
|
-
--xt-color-text-regular:
|
|
79
|
-
--xt-color-text-secondary:
|
|
80
|
-
--xt-color-text-placeholder:
|
|
81
|
-
--xt-color-text-disabled:
|
|
82
|
-
|
|
83
|
-
--xt-color-bg-primary: #
|
|
84
|
-
--xt-color-bg-secondary: #
|
|
85
|
-
--xt-color-bg-hover: #
|
|
86
|
-
--xt-color-bg-container: #
|
|
87
|
-
--xt-color-bg-overlay: #
|
|
88
|
-
|
|
89
|
-
--xt-color-border: #
|
|
90
|
-
--xt-color-border-light: #
|
|
91
|
-
--xt-color-border-lighter: #
|
|
92
|
-
--xt-color-border-extra-light: #
|
|
101
|
+
// 暗色主题
|
|
102
|
+
html[data-theme="dark"] {
|
|
103
|
+
--xt-color-primary: var(--xt-color-primary);
|
|
104
|
+
--xt-color-success: #{$xt-dark-color-success};
|
|
105
|
+
--xt-color-warning: #{$xt-dark-color-warning};
|
|
106
|
+
--xt-color-danger: #{$xt-dark-color-danger};
|
|
107
|
+
--xt-color-info: #{$xt-dark-color-info};
|
|
108
|
+
|
|
109
|
+
--xt-color-text-primary: #{$xt-dark-color-text-primary};
|
|
110
|
+
--xt-color-text-regular: #{$xt-dark-color-text-regular};
|
|
111
|
+
--xt-color-text-secondary: #{$xt-dark-color-text-secondary};
|
|
112
|
+
--xt-color-text-placeholder: #{$xt-dark-color-text-placeholder};
|
|
113
|
+
--xt-color-text-disabled: #{$xt-dark-color-text-disabled};
|
|
114
|
+
|
|
115
|
+
--xt-color-bg-primary: #{$xt-dark-color-bg-primary};
|
|
116
|
+
--xt-color-bg-secondary: #{$xt-dark-color-bg-secondary};
|
|
117
|
+
--xt-color-bg-hover: #{$xt-dark-color-bg-hover};
|
|
118
|
+
--xt-color-bg-container: #{$xt-dark-color-bg-container};
|
|
119
|
+
--xt-color-bg-overlay: #{$xt-dark-color-bg-overlay};
|
|
120
|
+
|
|
121
|
+
--xt-color-border: #{$xt-dark-color-border};
|
|
122
|
+
--xt-color-border-light: #{$xt-dark-color-border-light};
|
|
123
|
+
--xt-color-border-lighter: #{$xt-dark-color-border-lighter};
|
|
124
|
+
--xt-color-border-extra-light: #{$xt-dark-color-border-extra-light};
|
|
125
|
+
|
|
126
|
+
// 暗色主题下的组件变量
|
|
127
|
+
--xt-card-bg-color: #{$xt-dark-color-bg-primary};
|
|
128
|
+
--xt-card-border-color: #{$xt-dark-color-border};
|
|
129
|
+
--xt-input-bg-color: #{$xt-dark-color-bg-secondary};
|
|
130
|
+
--xt-input-border-color: #{$xt-dark-color-border};
|
|
131
|
+
--xt-input-text-color: #{$xt-dark-color-text-primary};
|
|
132
|
+
--xt-input-placeholder-color: #{$xt-dark-color-text-placeholder};
|
|
133
|
+
|
|
134
|
+
// 暗色主题按钮颜色变量
|
|
135
|
+
--xt-dark-button-primary-bg: #{$xt-dark-button-primary-bg};
|
|
136
|
+
--xt-dark-button-success-bg: #{$xt-dark-button-success-bg};
|
|
137
|
+
--xt-dark-button-warning-bg: #{$xt-dark-button-warning-bg};
|
|
138
|
+
--xt-dark-button-danger-bg: #{$xt-dark-button-danger-bg};
|
|
139
|
+
--xt-dark-button-info-bg: #{$xt-dark-button-info-bg};
|
|
93
140
|
}
|
|
94
141
|
|
|
95
|
-
// ===========================
|
|
96
142
|
// 字体大小主题(基于增量)
|
|
97
|
-
// ===========================
|
|
98
|
-
|
|
99
|
-
// 小字体主题 - 增量 0px
|
|
100
143
|
[data-size="small"] {
|
|
101
144
|
--xt-font-size-extra-large: #{$xt-font-size-extra-large + $xt-font-size-increment-small};
|
|
102
145
|
--xt-font-size-large: #{$xt-font-size-large + $xt-font-size-increment-small};
|
|
@@ -106,7 +149,6 @@
|
|
|
106
149
|
--xt-font-size-extra-small: #{$xt-font-size-extra-small + $xt-font-size-increment-small};
|
|
107
150
|
}
|
|
108
151
|
|
|
109
|
-
// 中等字体主题 - 增量 2px
|
|
110
152
|
[data-size="medium"] {
|
|
111
153
|
--xt-font-size-extra-large: #{$xt-font-size-extra-large + $xt-font-size-increment-medium};
|
|
112
154
|
--xt-font-size-large: #{$xt-font-size-large + $xt-font-size-increment-medium};
|
|
@@ -116,7 +158,6 @@
|
|
|
116
158
|
--xt-font-size-extra-small: #{$xt-font-size-extra-small + $xt-font-size-increment-medium};
|
|
117
159
|
}
|
|
118
160
|
|
|
119
|
-
// 大字体主题 - 增量 4px
|
|
120
161
|
[data-size="large"] {
|
|
121
162
|
--xt-font-size-extra-large: #{$xt-font-size-extra-large + $xt-font-size-increment-large};
|
|
122
163
|
--xt-font-size-large: #{$xt-font-size-large + $xt-font-size-increment-large};
|
|
@@ -84,16 +84,6 @@
|
|
|
84
84
|
--el-border-color-extra-light: #5c5c5d;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
/* 紧凑主题 */
|
|
88
|
-
[data-theme="compact"] {
|
|
89
|
-
--el-font-size-base: 13px;
|
|
90
|
-
--el-font-size-small: 12px;
|
|
91
|
-
|
|
92
|
-
--el-spacing-xs: 3px;
|
|
93
|
-
--el-spacing-sm: 6px;
|
|
94
|
-
--el-spacing-md: 10px;
|
|
95
|
-
--el-spacing-lg: 14px;
|
|
96
|
-
}
|
|
97
87
|
|
|
98
88
|
/* 大字体主题 */
|
|
99
89
|
[data-size="large"] {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
$xt-color-primary: #1890ff; // 主颜色 - XT UI 标准蓝色
|
|
2
|
+
$xt-color-success: #37c3a4; // 成功色 - XT UI 标准绿色
|
|
3
|
+
$xt-color-warning: #FFB74D; // 警告色 - XT UI 标准橙色
|
|
4
|
+
$xt-color-danger: #EA1D34; // 危险色 - XT UI 标准红色
|
|
5
|
+
$xt-color-info: #999999; // 信息色 - XT UI 标准灰色
|
|
6
|
+
|
|
7
|
+
$xt-color-primary-light-3: #5DB1FF; // 主色浅色 30%
|
|
8
|
+
$xt-color-primary-light-5: #8CC8FF; // 主色浅色 50%
|
|
9
|
+
$xt-color-primary-light-7: #BADEFF; // 主色浅色 70%
|
|
10
|
+
$xt-color-primary-light-8: #D1E9FF; // 主色浅色 80%
|
|
11
|
+
$xt-color-primary-light-9: #E8F4FF; // 主色浅色 90%
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// ===========================
|
|
2
|
+
// 按钮专用变量
|
|
3
|
+
// ===========================
|
|
4
|
+
$xt-button-height: 32px; // 按钮高度
|
|
5
|
+
$xt-button-padding-x: 15px; // 按钮水平内边距
|
|
6
|
+
$xt-button-padding-y: 8px; // 按钮垂直内边距
|
|
7
|
+
$xt-button-font-weight: 500; // 按钮字体粗细
|
|
8
|
+
$xt-button-border-width: 1px; // 按钮边框宽度
|
|
9
|
+
$xt-button-transition: 0.1s; // 按钮过渡时长
|
|
10
|
+
|
|
11
|
+
// ===========================
|
|
12
|
+
// 卡片专用变量
|
|
13
|
+
// ===========================
|
|
14
|
+
$xt-card-bg-color: #ffffff; // 卡片背景色
|
|
15
|
+
$xt-card-border-color: #EBEEF5; // 卡片边框颜色
|
|
16
|
+
$xt-card-border-radius: 4px; // 卡片圆角
|
|
17
|
+
$xt-card-padding: 20px; // 卡片内边距
|
|
18
|
+
$xt-card-header-padding: 18px 20px; // 卡片头部内边距
|
|
19
|
+
$xt-card-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); // 卡片阴影
|
|
20
|
+
|
|
21
|
+
// ===========================
|
|
22
|
+
// 卡片项专用变量
|
|
23
|
+
// ===========================
|
|
24
|
+
$xt-card-item-min-height: 40px; // 卡片项最小高度
|
|
25
|
+
$xt-card-item-gap: 10px; // 卡片项间距
|
|
26
|
+
$xt-card-item-border-width: 3px; // 卡片项边框宽度
|
|
27
|
+
|
|
28
|
+
// ===========================
|
|
29
|
+
// 输入框专用变量
|
|
30
|
+
// ===========================
|
|
31
|
+
$xt-input-height: 32px; // 输入框高度
|
|
32
|
+
$xt-input-padding-x: 15px; // 输入框水平内边距
|
|
33
|
+
$xt-input-bg-color: #ffffff; // 输入框背景色
|
|
34
|
+
$xt-input-border-color: #DCDFE6; // 输入框边框颜色
|
|
35
|
+
$xt-input-text-color: #303133; // 输入框文字颜色
|
|
36
|
+
$xt-input-placeholder-color: #C0C4CC; // 输入框占位符颜色
|
|
37
|
+
|
|
38
|
+
// ===========================
|
|
39
|
+
// FlexBox 专用变量
|
|
40
|
+
// ===========================
|
|
41
|
+
$xt-flex-box-gap: 8px; // FlexBox 默认间距
|
|
42
|
+
|
|
43
|
+
// ===========================
|
|
44
|
+
// 布局 / 头部 / 导航 专用变量
|
|
45
|
+
// ===========================
|
|
46
|
+
$xt-header-bg: #ffffff; // 头部背景色
|
|
47
|
+
$xt-header-text-color: #303133; // 头部文字颜色
|
|
48
|
+
$xt-header-active-text: #1890ff; // 头部激活状态文字颜色
|
|
49
|
+
$xt-header-hover-text: #1890ff; // 头部悬停状态文字颜色
|
|
50
|
+
|
|
51
|
+
$xt-hamburger-bg: #1890ff; // 汉堡按钮背景色
|
|
52
|
+
|
|
53
|
+
$xt-menu-bg: #304156; // 菜单背景色
|
|
54
|
+
$xt-menu-hover: #263445; // 菜单悬停背景色
|
|
55
|
+
$xt-menu-text: #bfcbd9; // 菜单文字颜色
|
|
56
|
+
$xt-menu-active-text: #ffffff; // 菜单激活状态文字颜色
|
|
57
|
+
|
|
58
|
+
$xt-sub-menu-bg: #1f2d3d; // 子菜单背景色
|
|
59
|
+
$xt-sub-menu-hover: #001528; // 子菜单悬停背景色
|
|
60
|
+
|
|
61
|
+
// ===========================
|
|
62
|
+
// 弹窗专用变量
|
|
63
|
+
// ===========================
|
|
64
|
+
$xt-dialog-bg: #ffffff; // 弹窗背景色
|
|
65
|
+
$xt-dialog-title: #303133; // 弹窗标题文字颜色
|
|
66
|
+
|
|
67
|
+
// ===========================
|
|
68
|
+
// TAG 标签专用变量
|
|
69
|
+
// ===========================
|
|
70
|
+
$xt-tag-bg: #ffffff; // 标签背景色
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
$xt-dark-color-primary: #0a7be0; // 暗色主题主色调
|
|
2
|
+
$xt-dark-color-success: #4BC376; // 暗色主题成功颜色
|
|
3
|
+
$xt-dark-color-warning: #E6B61e; // 暗色主题警告颜色
|
|
4
|
+
$xt-dark-color-danger: #c13737; // 暗色主题危险颜色
|
|
5
|
+
$xt-dark-color-info: #3f4249; // 暗色主题信息文字颜色
|
|
6
|
+
|
|
7
|
+
$xt-dark-color-text-primary: rgba(255, 255, 255, 0.95); // 暗色主题主要文字颜色
|
|
8
|
+
$xt-dark-color-text-regular: rgba(255, 255, 255, 0.8); // 暗色主题常规文字颜色
|
|
9
|
+
$xt-dark-color-text-secondary: rgba(255, 255, 255, 0.6); // 暗色主题次要文字颜色
|
|
10
|
+
$xt-dark-color-text-placeholder: rgba(255, 255, 255, 0.4); // 暗色主题占位符文字颜色
|
|
11
|
+
$xt-dark-color-text-disabled: rgba(255, 255, 255, 0.3); // 暗色主题禁用状态文字颜色
|
|
12
|
+
|
|
13
|
+
$xt-dark-color-bg-primary: #1f1f1f; // 暗色主题主背景色
|
|
14
|
+
$xt-dark-color-bg-secondary: #2d2d2d; // 暗色主题次要背景色
|
|
15
|
+
$xt-dark-color-bg-hover: #3d3d3d; // 暗色主题悬停背景色
|
|
16
|
+
$xt-dark-color-bg-container: #1f1f1f; // 暗色主题容器背景色
|
|
17
|
+
$xt-dark-color-bg-overlay: #2d2d2d; // 暗色主题浮层背景色
|
|
18
|
+
|
|
19
|
+
$xt-dark-color-border: #434343; // 暗色主题边框颜色
|
|
20
|
+
$xt-dark-color-border-light: #3d3d3d; // 暗色主题边框浅色
|
|
21
|
+
$xt-dark-color-border-lighter: #3d3d3d; // 暗色主题边框更浅色
|
|
22
|
+
$xt-dark-color-border-extra-light: #434343; // 暗色主题边框极浅色
|
|
23
|
+
|
|
24
|
+
// 暗色主题按钮颜色
|
|
25
|
+
$xt-dark-button-primary-bg: #1e40af; // 暗色主题主按钮背景色
|
|
26
|
+
$xt-dark-button-success-bg: #166534; // 暗色主题成功按钮背景色
|
|
27
|
+
$xt-dark-button-warning-bg: #78350f; // 暗色主题警告按钮背景色
|
|
28
|
+
$xt-dark-button-danger-bg: #991b1b; // 暗色主题危险按钮背景色
|
|
29
|
+
$xt-dark-button-info-bg: #374151; // 暗色主题信息按钮背景色
|