officialblock 1.0.7 → 1.0.9
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/dist/index-Ch_ldWmA.js +1 -0
- package/dist/index-DXm2cqxo.mjs +485 -0
- package/dist/official-block.cjs.js +74 -74
- package/dist/official-block.es.js +13608 -10831
- package/dist/official-block.umd.js +78 -78
- package/dist/style.css +1 -1
- package/dist/swiper-JiLDDxAF.js +1 -0
- package/dist/swiper-acbnDJoL.mjs +2035 -0
- package/dist/utils-DD-vVZej.mjs +316 -0
- package/dist/utils-DOLLD0-F.js +1 -0
- package/package.json +2 -1
- package/src/assets/icon-email.svg +3 -0
- package/src/components/ArticleList/article.vue +3 -3
- package/src/components/ArticleList/contact.vue +9 -9
- package/src/components/ArticleList/index.ts +1 -1
- package/src/components/ArticleList/index.vue +22 -80
- package/src/components/ArticleList/setting.vue +339 -175
- package/src/components/ArticleList/type.ts +12 -18
- package/src/components/BannerImage/index.ts +11 -0
- package/src/components/BannerImage/index.vue +153 -0
- package/src/components/BannerImage/setting.vue +55 -0
- package/src/components/BannerImage/type.ts +10 -0
- package/src/components/BannerImageWithLink/index.ts +11 -0
- package/src/components/BannerImageWithLink/index.vue +323 -0
- package/src/components/BannerImageWithLink/setting.vue +344 -0
- package/src/components/BannerImageWithLink/type.ts +17 -0
- package/src/components/BannerPage/index.ts +11 -0
- package/src/components/BannerPage/index.vue +283 -0
- package/src/components/BannerPage/setting.vue +55 -0
- package/src/components/BannerPage/type.ts +10 -0
- package/src/components/BtnList/index.ts +11 -0
- package/src/components/BtnList/index.vue +588 -0
- package/src/components/BtnList/setting.vue +255 -0
- package/src/components/BtnList/type.ts +10 -0
- package/src/components/Button/index.vue +45 -33
- package/src/components/ContactUsList/index.ts +11 -0
- package/src/components/ContactUsList/index.vue +369 -0
- package/src/components/ContactUsList/setting.vue +497 -0
- package/src/components/ContactUsList/type.ts +17 -0
- package/src/components/CountDown/index.ts +11 -0
- package/src/components/CountDown/index.vue +315 -0
- package/src/components/CountDown/setting.vue +302 -0
- package/src/components/CountDown/type.ts +17 -0
- package/src/components/CustomIframe/index.ts +11 -0
- package/src/components/CustomIframe/index.vue +118 -0
- package/src/components/CustomIframe/setting.vue +323 -0
- package/src/components/CustomIframe/type.ts +17 -0
- package/src/components/CustomSpace/index.ts +11 -0
- package/src/components/CustomSpace/index.vue +82 -0
- package/src/components/CustomSpace/setting.vue +89 -0
- package/src/components/CustomSpace/type.ts +10 -0
- package/src/components/GalleryList/index.ts +12 -0
- package/src/components/GalleryList/index.vue +311 -0
- package/src/components/GalleryList/setting.vue +268 -0
- package/src/components/GalleryList/type.ts +10 -0
- package/src/components/HeroSlide/index.ts +1 -1
- package/src/components/HeroSlide/index.vue +85 -133
- package/src/components/HeroSlide/setting.vue +435 -0
- package/src/components/HeroSlide/type.ts +5 -14
- package/src/components/LinkLIst/index.ts +11 -0
- package/src/components/LinkLIst/index.vue +317 -0
- package/src/components/LinkLIst/setting.vue +264 -0
- package/src/components/LinkLIst/type.ts +10 -0
- package/src/components/Media/index.vue +18 -18
- package/src/components/Operate/index.vue +17 -8
- package/src/components/Profile/index.vue +999 -0
- package/src/components/Profile/modal.vue +56 -0
- package/src/components/Profile/setting.vue +330 -0
- package/src/components/QuickLinks/index.vue +166 -0
- package/src/components/QuoteText/index.ts +11 -0
- package/src/components/QuoteText/index.vue +133 -0
- package/src/components/QuoteText/setting.vue +81 -0
- package/src/components/QuoteText/type.ts +10 -0
- package/src/components/ScrollKeyInfo/index.ts +11 -0
- package/src/components/ScrollKeyInfo/index.vue +1345 -0
- package/src/components/ScrollKeyInfo/setting.vue +302 -0
- package/src/components/ScrollKeyInfo/type.ts +17 -0
- package/src/components/Swiper/index.vue +538 -0
- package/src/components/TabDefault/components/ComponentSelector/compsData.js +143 -0
- package/src/components/TabDefault/components/ComponentSelector/index.vue +188 -0
- package/src/components/TabDefault/components/PageContent.vue +207 -0
- package/src/components/TabDefault/index.vue +475 -0
- package/src/components/TabDefault/setting.vue +581 -0
- package/src/components/TabDefault/type.ts +17 -0
- package/src/components/TableTwo/index.ts +11 -0
- package/src/components/TableTwo/index.vue +232 -0
- package/src/components/TableTwo/setting.vue +558 -0
- package/src/components/TableTwo/type.ts +17 -0
- package/src/components/index.ts +40 -5
- package/src/index.ts +56 -12
- package/src/main.ts +6 -3
- package/src/router/index.ts +6 -0
- package/src/style.css +17 -0
- package/src/styles/component-isolation.scss +257 -0
- package/src/styles/editor.scss +1 -1
- package/src/styles/layers.scss +256 -0
- package/src/styles/main.scss +21687 -0
- package/src/styles/mixins/style-isolation.scss +262 -0
- package/src/styles/smart-reset.scss +287 -0
- package/src/styles/test.scss +1 -1
- package/src/types/button.ts +10 -0
- package/src/views/StyleIsolationTest.vue +292 -0
- package/src/views/components/ArticleListDemo.vue +59 -19
package/src/index.ts
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import type { App, Plugin } from 'vue'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ArticleList,
|
|
4
|
+
BannerImage,
|
|
5
|
+
BannerPage,
|
|
6
|
+
BtnList,
|
|
7
|
+
CustomSpace,
|
|
8
|
+
GalleryList,
|
|
9
|
+
HeroSlide,
|
|
10
|
+
LinkList,
|
|
11
|
+
QuoteText
|
|
12
|
+
} from './components'
|
|
3
13
|
|
|
4
14
|
// 全部引入插件
|
|
5
15
|
const OfficialBlock = {
|
|
6
16
|
install: (app: App) => {
|
|
7
17
|
app.component('ArticleList', ArticleList)
|
|
18
|
+
app.component('BannerImage', BannerImage)
|
|
19
|
+
app.component('BannerPage', BannerPage)
|
|
20
|
+
app.component('BtnList', BtnList)
|
|
21
|
+
app.component('CustomSpace', CustomSpace)
|
|
22
|
+
app.component('GalleryList', GalleryList)
|
|
8
23
|
app.component('HeroSlide', HeroSlide)
|
|
9
|
-
app.component('
|
|
10
|
-
app.component('
|
|
24
|
+
app.component('LinkList', LinkList)
|
|
25
|
+
app.component('QuoteText', QuoteText)
|
|
11
26
|
},
|
|
12
27
|
} satisfies Plugin
|
|
13
28
|
|
|
@@ -15,10 +30,30 @@ const OfficialBlock = {
|
|
|
15
30
|
export default OfficialBlock
|
|
16
31
|
|
|
17
32
|
// 按需引入 - 导出组件
|
|
18
|
-
export {
|
|
33
|
+
export {
|
|
34
|
+
ArticleList,
|
|
35
|
+
BannerImage,
|
|
36
|
+
BannerPage,
|
|
37
|
+
BtnList,
|
|
38
|
+
CustomSpace,
|
|
39
|
+
GalleryList,
|
|
40
|
+
HeroSlide,
|
|
41
|
+
LinkList,
|
|
42
|
+
QuoteText
|
|
43
|
+
}
|
|
19
44
|
|
|
20
45
|
// 按需引入 - 导出单个组件的插件
|
|
21
|
-
export {
|
|
46
|
+
export {
|
|
47
|
+
ArticleListPlugin,
|
|
48
|
+
BannerImagePlugin,
|
|
49
|
+
BannerPagePlugin,
|
|
50
|
+
BtnListPlugin,
|
|
51
|
+
CustomSpacePlugin,
|
|
52
|
+
GalleryListPlugin,
|
|
53
|
+
HeroSlidePlugin,
|
|
54
|
+
LinkListPlugin,
|
|
55
|
+
QuoteTextPlugin
|
|
56
|
+
} from './components'
|
|
22
57
|
|
|
23
58
|
// 导出主题相关功能
|
|
24
59
|
export { useTheme } from './composables/useTheme'
|
|
@@ -26,15 +61,24 @@ export { ThemeUtils, ResponsiveUtils, AnimationUtils, StorageUtils } from './uti
|
|
|
26
61
|
|
|
27
62
|
// 导出类型定义
|
|
28
63
|
export type {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
64
|
+
ArticleListProps,
|
|
65
|
+
ArticleListEmits,
|
|
66
|
+
BannerImageProps,
|
|
67
|
+
BannerImageEmits,
|
|
68
|
+
BannerPageProps,
|
|
69
|
+
BannerPageEmits,
|
|
70
|
+
BtnListProps,
|
|
71
|
+
BtnListEmits,
|
|
72
|
+
CustomSpaceProps,
|
|
73
|
+
CustomSpaceEmits,
|
|
74
|
+
GalleryListProps,
|
|
75
|
+
GalleryListEmits,
|
|
32
76
|
HeroSlideProps,
|
|
33
77
|
HeroSlideEmits,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
78
|
+
LinkListProps,
|
|
79
|
+
LinkListEmits,
|
|
80
|
+
QuoteTextProps,
|
|
81
|
+
QuoteTextEmits,
|
|
38
82
|
} from './components'
|
|
39
83
|
|
|
40
84
|
export type { ThemeConfig } from './composables/useTheme'
|
package/src/main.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { createApp } from 'vue'
|
|
2
|
-
|
|
3
|
-
import './styles/
|
|
2
|
+
// 使用 CSS 层级管理系统来控制样式优先级
|
|
3
|
+
import './styles/layers.scss' // 1. CSS 层级管理(包含所有层级定义)
|
|
4
|
+
import './style.css' // 2. 基础样式
|
|
5
|
+
import './styles/main.scss' // 3. 全局样式(会被放入 vendors 层)
|
|
6
|
+
import '@arco-design/web-vue/dist/arco.css' // 4. 第三方库样式(会被放入 vendors 层)
|
|
7
|
+
import './styles/component-isolation.scss' // 5. 组件隔离工具(会被放入 utilities 层)
|
|
4
8
|
import App from './App.vue'
|
|
5
9
|
import router from './router'
|
|
6
10
|
import ArcoVue from '@arco-design/web-vue'
|
|
7
11
|
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
|
|
8
|
-
import '@arco-design/web-vue/dist/arco.css'
|
|
9
12
|
|
|
10
13
|
const app = createApp(App)
|
|
11
14
|
app.use(router)
|
package/src/router/index.ts
CHANGED
|
@@ -74,6 +74,12 @@ const routes: RouteRecordRaw[] = [
|
|
|
74
74
|
}
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
|
+
{
|
|
78
|
+
path: '/style-isolation-test',
|
|
79
|
+
name: 'StyleIsolationTest',
|
|
80
|
+
component: () => import('../views/StyleIsolationTest.vue'),
|
|
81
|
+
meta: { title: '样式隔离测试' }
|
|
82
|
+
},
|
|
77
83
|
{
|
|
78
84
|
path: '/:pathMatch(.*)*',
|
|
79
85
|
name: 'NotFound',
|
package/src/style.css
CHANGED
|
@@ -75,3 +75,20 @@ button:focus-visible {
|
|
|
75
75
|
background-color: #f9f9f9;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
:root {
|
|
80
|
+
--primary-color: #d65a00;
|
|
81
|
+
--link-active-color: #ff8200;
|
|
82
|
+
--link-blue-color: #172386;
|
|
83
|
+
--link-light-color: rgba(255, 255, 255, 1);
|
|
84
|
+
--label-color: #d65a00;
|
|
85
|
+
--quote-line-color: #ff8200;
|
|
86
|
+
--quote-text-color: #172386;
|
|
87
|
+
--tab-color: #ff8200;
|
|
88
|
+
--tab-color--search: #ff8200;
|
|
89
|
+
--text-color--primary: #0032a0;
|
|
90
|
+
--header-height: 72px;
|
|
91
|
+
--header-height-calc: 72px;
|
|
92
|
+
--alert-height: 0px;
|
|
93
|
+
--vh: 8.57px;
|
|
94
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组件样式隔离
|
|
3
|
+
* 用于确保组件样式不被全局样式污染
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// 导入样式隔离 mixins
|
|
7
|
+
// @import './mixins/style-isolation.scss';
|
|
8
|
+
@use './mixins/style-isolation.scss' as *;
|
|
9
|
+
|
|
10
|
+
// 创建一个组件隔离容器
|
|
11
|
+
.component-isolation {
|
|
12
|
+
// 重置字体继承,让组件可以自由设置字体大小
|
|
13
|
+
font-size: initial;
|
|
14
|
+
font-family: initial;
|
|
15
|
+
font-weight: initial;
|
|
16
|
+
line-height: initial;
|
|
17
|
+
|
|
18
|
+
// 重置其他可能被继承的样式
|
|
19
|
+
color: initial;
|
|
20
|
+
text-align: initial;
|
|
21
|
+
text-decoration: initial;
|
|
22
|
+
text-transform: initial;
|
|
23
|
+
letter-spacing: initial;
|
|
24
|
+
|
|
25
|
+
// 确保子元素不继承全局样式
|
|
26
|
+
* {
|
|
27
|
+
font-size: inherit;
|
|
28
|
+
font-family: inherit;
|
|
29
|
+
font-weight: inherit;
|
|
30
|
+
line-height: inherit;
|
|
31
|
+
color: inherit;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 为特定组件提供样式隔离
|
|
36
|
+
.operate-component-isolation {
|
|
37
|
+
@include operate-component-isolation();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 通用的字体大小工具类(不会被全局样式覆盖)
|
|
41
|
+
.fs-isolated {
|
|
42
|
+
&-8 { font-size: 8px !important; }
|
|
43
|
+
&-9 { font-size: 9px !important; }
|
|
44
|
+
&-10 { font-size: 10px !important; }
|
|
45
|
+
&-11 { font-size: 11px !important; }
|
|
46
|
+
&-12 { font-size: 12px !important; }
|
|
47
|
+
&-13 { font-size: 13px !important; }
|
|
48
|
+
&-14 { font-size: 14px !important; }
|
|
49
|
+
&-15 { font-size: 15px !important; }
|
|
50
|
+
&-16 { font-size: 16px !important; }
|
|
51
|
+
&-18 { font-size: 18px !important; }
|
|
52
|
+
&-20 { font-size: 20px !important; }
|
|
53
|
+
&-24 { font-size: 24px !important; }
|
|
54
|
+
&-28 { font-size: 28px !important; }
|
|
55
|
+
&-32 { font-size: 32px !important; }
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 字体权重工具类
|
|
59
|
+
.fw-isolated {
|
|
60
|
+
&-100 { font-weight: 100 !important; }
|
|
61
|
+
&-200 { font-weight: 200 !important; }
|
|
62
|
+
&-300 { font-weight: 300 !important; }
|
|
63
|
+
&-400 { font-weight: 400 !important; }
|
|
64
|
+
&-500 { font-weight: 500 !important; }
|
|
65
|
+
&-600 { font-weight: 600 !important; }
|
|
66
|
+
&-700 { font-weight: 700 !important; }
|
|
67
|
+
&-800 { font-weight: 800 !important; }
|
|
68
|
+
&-900 { font-weight: 900 !important; }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 行高工具类
|
|
72
|
+
.lh-isolated {
|
|
73
|
+
&-1 { line-height: 1 !important; }
|
|
74
|
+
&-1-2 { line-height: 1.2 !important; }
|
|
75
|
+
&-1-4 { line-height: 1.4 !important; }
|
|
76
|
+
&-1-5 { line-height: 1.5 !important; }
|
|
77
|
+
&-1-6 { line-height: 1.6 !important; }
|
|
78
|
+
&-2 { line-height: 2 !important; }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// 颜色工具类(不会被全局样式覆盖)
|
|
82
|
+
.text-isolated {
|
|
83
|
+
&-white { color: #ffffff !important; }
|
|
84
|
+
&-black { color: #000000 !important; }
|
|
85
|
+
&-gray-100 { color: #f8f9fa !important; }
|
|
86
|
+
&-gray-200 { color: #e9ecef !important; }
|
|
87
|
+
&-gray-300 { color: #dee2e6 !important; }
|
|
88
|
+
&-gray-400 { color: #ced4da !important; }
|
|
89
|
+
&-gray-500 { color: #adb5bd !important; }
|
|
90
|
+
&-gray-600 { color: #6c757d !important; }
|
|
91
|
+
&-gray-700 { color: #495057 !important; }
|
|
92
|
+
&-gray-800 { color: #343a40 !important; }
|
|
93
|
+
&-gray-900 { color: #212529 !important; }
|
|
94
|
+
&-primary { color: #007bff !important; }
|
|
95
|
+
&-secondary { color: #6c757d !important; }
|
|
96
|
+
&-success { color: #28a745 !important; }
|
|
97
|
+
&-danger { color: #dc3545 !important; }
|
|
98
|
+
&-warning { color: #ffc107 !important; }
|
|
99
|
+
&-info { color: #17a2b8 !important; }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 背景色工具类
|
|
103
|
+
.bg-isolated {
|
|
104
|
+
&-white { background-color: #ffffff !important; }
|
|
105
|
+
&-black { background-color: #000000 !important; }
|
|
106
|
+
&-transparent { background-color: transparent !important; }
|
|
107
|
+
&-primary { background-color: #007bff !important; }
|
|
108
|
+
&-secondary { background-color: #6c757d !important; }
|
|
109
|
+
&-success { background-color: #28a745 !important; }
|
|
110
|
+
&-danger { background-color: #dc3545 !important; }
|
|
111
|
+
&-warning { background-color: #ffc107 !important; }
|
|
112
|
+
&-info { background-color: #17a2b8 !important; }
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 边距工具类(不会被全局样式覆盖)
|
|
116
|
+
.m-isolated {
|
|
117
|
+
&-0 { margin: 0 !important; }
|
|
118
|
+
&-1 { margin: 0.25rem !important; }
|
|
119
|
+
&-2 { margin: 0.5rem !important; }
|
|
120
|
+
&-3 { margin: 1rem !important; }
|
|
121
|
+
&-4 { margin: 1.5rem !important; }
|
|
122
|
+
&-5 { margin: 3rem !important; }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.p-isolated {
|
|
126
|
+
&-0 { padding: 0 !important; }
|
|
127
|
+
&-1 { padding: 0.25rem !important; }
|
|
128
|
+
&-2 { padding: 0.5rem !important; }
|
|
129
|
+
&-3 { padding: 1rem !important; }
|
|
130
|
+
&-4 { padding: 1.5rem !important; }
|
|
131
|
+
&-5 { padding: 3rem !important; }
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 显示工具类
|
|
135
|
+
.d-isolated {
|
|
136
|
+
&-none { display: none !important; }
|
|
137
|
+
&-block { display: block !important; }
|
|
138
|
+
&-inline { display: inline !important; }
|
|
139
|
+
&-inline-block { display: inline-block !important; }
|
|
140
|
+
&-flex { display: flex !important; }
|
|
141
|
+
&-inline-flex { display: inline-flex !important; }
|
|
142
|
+
&-grid { display: grid !important; }
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Flex 工具类
|
|
146
|
+
.flex-isolated {
|
|
147
|
+
&-row { flex-direction: row !important; }
|
|
148
|
+
&-column { flex-direction: column !important; }
|
|
149
|
+
&-wrap { flex-wrap: wrap !important; }
|
|
150
|
+
&-nowrap { flex-wrap: nowrap !important; }
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.justify-isolated {
|
|
154
|
+
&-start { justify-content: flex-start !important; }
|
|
155
|
+
&-center { justify-content: center !important; }
|
|
156
|
+
&-end { justify-content: flex-end !important; }
|
|
157
|
+
&-between { justify-content: space-between !important; }
|
|
158
|
+
&-around { justify-content: space-around !important; }
|
|
159
|
+
&-evenly { justify-content: space-evenly !important; }
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.align-isolated {
|
|
163
|
+
&-start { align-items: flex-start !important; }
|
|
164
|
+
&-center { align-items: center !important; }
|
|
165
|
+
&-end { align-items: flex-end !important; }
|
|
166
|
+
&-stretch { align-items: stretch !important; }
|
|
167
|
+
&-baseline { align-items: baseline !important; }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// 边框工具类
|
|
171
|
+
.border-isolated {
|
|
172
|
+
&-0 { border: 0 !important; }
|
|
173
|
+
&-1 { border: 1px solid #dee2e6 !important; }
|
|
174
|
+
&-2 { border: 2px solid #dee2e6 !important; }
|
|
175
|
+
&-3 { border: 3px solid #dee2e6 !important; }
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.rounded-isolated {
|
|
179
|
+
&-0 { border-radius: 0 !important; }
|
|
180
|
+
&-1 { border-radius: 0.25rem !important; }
|
|
181
|
+
&-2 { border-radius: 0.375rem !important; }
|
|
182
|
+
&-3 { border-radius: 0.5rem !important; }
|
|
183
|
+
&-circle { border-radius: 50% !important; }
|
|
184
|
+
&-pill { border-radius: 50rem !important; }
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 位置工具类
|
|
188
|
+
.position-isolated {
|
|
189
|
+
&-static { position: static !important; }
|
|
190
|
+
&-relative { position: relative !important; }
|
|
191
|
+
&-absolute { position: absolute !important; }
|
|
192
|
+
&-fixed { position: fixed !important; }
|
|
193
|
+
&-sticky { position: sticky !important; }
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// 宽度和高度工具类
|
|
197
|
+
.w-isolated {
|
|
198
|
+
&-auto { width: auto !important; }
|
|
199
|
+
&-25 { width: 25% !important; }
|
|
200
|
+
&-50 { width: 50% !important; }
|
|
201
|
+
&-75 { width: 75% !important; }
|
|
202
|
+
&-100 { width: 100% !important; }
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.h-isolated {
|
|
206
|
+
&-auto { height: auto !important; }
|
|
207
|
+
&-25 { height: 25% !important; }
|
|
208
|
+
&-50 { height: 50% !important; }
|
|
209
|
+
&-75 { height: 75% !important; }
|
|
210
|
+
&-100 { height: 100% !important; }
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// 文本对齐工具类
|
|
214
|
+
.text-align-isolated {
|
|
215
|
+
&-left { text-align: left !important; }
|
|
216
|
+
&-center { text-align: center !important; }
|
|
217
|
+
&-right { text-align: right !important; }
|
|
218
|
+
&-justify { text-align: justify !important; }
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// 光标工具类
|
|
222
|
+
.cursor-isolated {
|
|
223
|
+
&-auto { cursor: auto !important; }
|
|
224
|
+
&-default { cursor: default !important; }
|
|
225
|
+
&-pointer { cursor: pointer !important; }
|
|
226
|
+
&-wait { cursor: wait !important; }
|
|
227
|
+
&-text { cursor: text !important; }
|
|
228
|
+
&-move { cursor: move !important; }
|
|
229
|
+
&-not-allowed { cursor: not-allowed !important; }
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// 用户选择工具类
|
|
233
|
+
.user-select-isolated {
|
|
234
|
+
&-none { user-select: none !important; }
|
|
235
|
+
&-auto { user-select: auto !important; }
|
|
236
|
+
&-text { user-select: text !important; }
|
|
237
|
+
&-all { user-select: all !important; }
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// 溢出工具类
|
|
241
|
+
.overflow-isolated {
|
|
242
|
+
&-auto { overflow: auto !important; }
|
|
243
|
+
&-hidden { overflow: hidden !important; }
|
|
244
|
+
&-visible { overflow: visible !important; }
|
|
245
|
+
&-scroll { overflow: scroll !important; }
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Z-index 工具类
|
|
249
|
+
.z-isolated {
|
|
250
|
+
&-0 { z-index: 0 !important; }
|
|
251
|
+
&-10 { z-index: 10 !important; }
|
|
252
|
+
&-20 { z-index: 20 !important; }
|
|
253
|
+
&-30 { z-index: 30 !important; }
|
|
254
|
+
&-40 { z-index: 40 !important; }
|
|
255
|
+
&-50 { z-index: 50 !important; }
|
|
256
|
+
&-auto { z-index: auto !important; }
|
|
257
|
+
}
|
package/src/styles/editor.scss
CHANGED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS 层级管理
|
|
3
|
+
* 使用 @layer 规则来明确定义样式优先级
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* 定义层级顺序(从低到高优先级) */
|
|
7
|
+
@layer reset, base, vendors, components, utilities, overrides;
|
|
8
|
+
|
|
9
|
+
/* 重置层 - 最低优先级 */
|
|
10
|
+
@layer reset {
|
|
11
|
+
/* 基础重置样式 */
|
|
12
|
+
*,
|
|
13
|
+
*::before,
|
|
14
|
+
*::after {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
* {
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
html {
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
line-height: 1.15;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body {
|
|
29
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
30
|
+
/* 不设置 font-size,让后续层级控制 */
|
|
31
|
+
font-weight: 400;
|
|
32
|
+
line-height: 1.5;
|
|
33
|
+
color: #212529;
|
|
34
|
+
background-color: #fff;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* 基础层 - 基础样式 */
|
|
39
|
+
@layer base {
|
|
40
|
+
/* 这里可以放置基础的样式设置 */
|
|
41
|
+
:root {
|
|
42
|
+
--font-size-xs: 12px;
|
|
43
|
+
--font-size-sm: 14px;
|
|
44
|
+
--font-size-base: 16px;
|
|
45
|
+
--font-size-lg: 18px;
|
|
46
|
+
--font-size-xl: 20px;
|
|
47
|
+
|
|
48
|
+
--color-primary: #007bff;
|
|
49
|
+
--color-success: #28a745;
|
|
50
|
+
--color-warning: #ffc107;
|
|
51
|
+
--color-danger: #dc3545;
|
|
52
|
+
--color-info: #17a2b8;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* 默认字体大小设置 */
|
|
56
|
+
body {
|
|
57
|
+
font-size: var(--font-size-sm); /* 14px 作为默认值 */
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* 第三方库层 */
|
|
62
|
+
@layer vendors {
|
|
63
|
+
/* 这里会放置第三方库的样式 */
|
|
64
|
+
/* Arco Design 等第三方库样式会在这一层 */
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* 组件层 - 组件样式 */
|
|
68
|
+
@layer components {
|
|
69
|
+
/* 组件样式会在这一层,优先级高于基础层和第三方库层 */
|
|
70
|
+
|
|
71
|
+
/* Operate 组件样式 */
|
|
72
|
+
.operate-component {
|
|
73
|
+
.operate-btn {
|
|
74
|
+
.btn-item {
|
|
75
|
+
font-size: 10px; /* 这里不需要 !important,因为层级优先级更高 */
|
|
76
|
+
color: #fff;
|
|
77
|
+
font-weight: 600;
|
|
78
|
+
padding: 4px 16px;
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
transition: all 0.2s ease;
|
|
82
|
+
|
|
83
|
+
&:hover {
|
|
84
|
+
transform: translateY(-1px);
|
|
85
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.btn-copy {
|
|
90
|
+
background: var(--color-warning);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.btn-delete {
|
|
94
|
+
background: var(--color-danger);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.btn-edit {
|
|
98
|
+
background: var(--color-primary);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* 工具类层 */
|
|
105
|
+
@layer utilities {
|
|
106
|
+
/* 工具类样式,优先级很高 */
|
|
107
|
+
.fs-10 { font-size: 10px; }
|
|
108
|
+
.fs-12 { font-size: 12px; }
|
|
109
|
+
.fs-14 { font-size: 14px; }
|
|
110
|
+
.fs-16 { font-size: 16px; }
|
|
111
|
+
.fs-18 { font-size: 18px; }
|
|
112
|
+
.fs-20 { font-size: 20px; }
|
|
113
|
+
|
|
114
|
+
.fw-300 { font-weight: 300; }
|
|
115
|
+
.fw-400 { font-weight: 400; }
|
|
116
|
+
.fw-500 { font-weight: 500; }
|
|
117
|
+
.fw-600 { font-weight: 600; }
|
|
118
|
+
.fw-700 { font-weight: 700; }
|
|
119
|
+
|
|
120
|
+
.text-primary { color: var(--color-primary); }
|
|
121
|
+
.text-success { color: var(--color-success); }
|
|
122
|
+
.text-warning { color: var(--color-warning); }
|
|
123
|
+
.text-danger { color: var(--color-danger); }
|
|
124
|
+
.text-info { color: var(--color-info); }
|
|
125
|
+
|
|
126
|
+
.bg-primary { background-color: var(--color-primary); }
|
|
127
|
+
.bg-success { background-color: var(--color-success); }
|
|
128
|
+
.bg-warning { background-color: var(--color-warning); }
|
|
129
|
+
.bg-danger { background-color: var(--color-danger); }
|
|
130
|
+
.bg-info { background-color: var(--color-info); }
|
|
131
|
+
|
|
132
|
+
.d-none { display: none; }
|
|
133
|
+
.d-block { display: block; }
|
|
134
|
+
.d-flex { display: flex; }
|
|
135
|
+
.d-inline-flex { display: inline-flex; }
|
|
136
|
+
|
|
137
|
+
.justify-start { justify-content: flex-start; }
|
|
138
|
+
.justify-center { justify-content: center; }
|
|
139
|
+
.justify-end { justify-content: flex-end; }
|
|
140
|
+
.justify-between { justify-content: space-between; }
|
|
141
|
+
|
|
142
|
+
.align-start { align-items: flex-start; }
|
|
143
|
+
.align-center { align-items: center; }
|
|
144
|
+
.align-end { align-items: flex-end; }
|
|
145
|
+
|
|
146
|
+
.m-0 { margin: 0; }
|
|
147
|
+
.m-1 { margin: 0.25rem; }
|
|
148
|
+
.m-2 { margin: 0.5rem; }
|
|
149
|
+
.m-3 { margin: 1rem; }
|
|
150
|
+
.m-4 { margin: 1.5rem; }
|
|
151
|
+
|
|
152
|
+
.p-0 { padding: 0; }
|
|
153
|
+
.p-1 { padding: 0.25rem; }
|
|
154
|
+
.p-2 { padding: 0.5rem; }
|
|
155
|
+
.p-3 { padding: 1rem; }
|
|
156
|
+
.p-4 { padding: 1.5rem; }
|
|
157
|
+
|
|
158
|
+
.border { border: 1px solid #dee2e6; }
|
|
159
|
+
.border-0 { border: 0; }
|
|
160
|
+
.rounded { border-radius: 0.375rem; }
|
|
161
|
+
.rounded-0 { border-radius: 0; }
|
|
162
|
+
|
|
163
|
+
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); }
|
|
164
|
+
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); }
|
|
165
|
+
.shadow-none { box-shadow: none; }
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* 覆盖层 - 最高优先级 */
|
|
169
|
+
@layer overrides {
|
|
170
|
+
/* 这里放置需要强制覆盖的样式 */
|
|
171
|
+
/* 通常应该避免使用这一层,除非绝对必要 */
|
|
172
|
+
|
|
173
|
+
/* 特殊情况下的样式覆盖 */
|
|
174
|
+
.force-font-10 {
|
|
175
|
+
font-size: 10px;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.force-font-12 {
|
|
179
|
+
font-size: 12px;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* 响应式工具类 */
|
|
184
|
+
@media (max-width: 575.98px) {
|
|
185
|
+
@layer utilities {
|
|
186
|
+
.fs-sm-10 { font-size: 10px; }
|
|
187
|
+
.fs-sm-12 { font-size: 12px; }
|
|
188
|
+
.fs-sm-14 { font-size: 14px; }
|
|
189
|
+
|
|
190
|
+
.d-sm-none { display: none; }
|
|
191
|
+
.d-sm-block { display: block; }
|
|
192
|
+
.d-sm-flex { display: flex; }
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@media (max-width: 767.98px) {
|
|
197
|
+
@layer utilities {
|
|
198
|
+
.fs-md-10 { font-size: 10px; }
|
|
199
|
+
.fs-md-12 { font-size: 12px; }
|
|
200
|
+
.fs-md-14 { font-size: 14px; }
|
|
201
|
+
|
|
202
|
+
.d-md-none { display: none; }
|
|
203
|
+
.d-md-block { display: block; }
|
|
204
|
+
.d-md-flex { display: flex; }
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@media (max-width: 991.98px) {
|
|
209
|
+
@layer utilities {
|
|
210
|
+
.fs-lg-10 { font-size: 10px; }
|
|
211
|
+
.fs-lg-12 { font-size: 12px; }
|
|
212
|
+
.fs-lg-14 { font-size: 14px; }
|
|
213
|
+
|
|
214
|
+
.d-lg-none { display: none; }
|
|
215
|
+
.d-lg-block { display: block; }
|
|
216
|
+
.d-lg-flex { display: flex; }
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* 打印样式 */
|
|
221
|
+
@media print {
|
|
222
|
+
@layer utilities {
|
|
223
|
+
.print-hidden { display: none; }
|
|
224
|
+
.print-visible { display: block; }
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* 暗色主题支持 */
|
|
229
|
+
@media (prefers-color-scheme: dark) {
|
|
230
|
+
@layer base {
|
|
231
|
+
:root {
|
|
232
|
+
--color-text: #ffffff;
|
|
233
|
+
--color-bg: #1a1a1a;
|
|
234
|
+
--color-border: #333333;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
body {
|
|
238
|
+
color: var(--color-text);
|
|
239
|
+
background-color: var(--color-bg);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* 减少动画偏好支持 */
|
|
245
|
+
@media (prefers-reduced-motion: reduce) {
|
|
246
|
+
@layer base {
|
|
247
|
+
*,
|
|
248
|
+
*::before,
|
|
249
|
+
*::after {
|
|
250
|
+
animation-duration: 0.01ms !important;
|
|
251
|
+
animation-iteration-count: 1 !important;
|
|
252
|
+
transition-duration: 0.01ms !important;
|
|
253
|
+
scroll-behavior: auto !important;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|