@gct-paas/scss 0.1.6-dev.3 → 0.1.6-dev.30

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.
@@ -1 +1,2 @@
1
- function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e,r,n,s){let o=`${t}-${e}`;return r&&(o+=`-${r}`),n&&(o+=`__${n}`),s&&(o+=`--${s}`),o}var r=class{constructor(e,r){var n,s,o;n=this,o=void 0,(s=function(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}(s="namespace"))in n?Object.defineProperty(n,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[s]=o,this.block=e,this.namespace=r||"gct"}b(t=""){return e(this.namespace,this.block,t,"","")}e(t){return t?e(this.namespace,this.block,"",t,""):""}m(t){return t?e(this.namespace,this.block,"","",t):""}be(t,r){return t&&r?e(this.namespace,this.block,t,r,""):""}em(t,r){return t&&r?e(this.namespace,this.block,"",t,r):""}bm(t,r){return t&&r?e(this.namespace,this.block,t,"",r):""}bem(t,r,n){return t&&r&&n?e(this.namespace,this.block,t,r,n):""}is(t,e){return t&&e?`is-${t}`:""}cssVar(t){const e={};for(const r in t)t[r]&&(e[this.cssVarName(r)]=t[r]);return e}cssVarBlock(t){const e={};for(const r in t)t[r]&&(e[this.cssVarBlockName(r)]=t[r]);return e}cssVarName(t){return`--${this.namespace}-${t}`}cssVarBlockName(t){return`--${this.namespace}-${this.block}-${t}`}};export{r as Namespace};
1
+ /*! @gct-paas/scss v0.1.6-dev.30 */
2
+ function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(e,r,n){return(r=function(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function r(t,e,r,n,o){let s=`${t}-${e}`;return r&&(s+=`-${r}`),n&&(s+=`__${n}`),o&&(s+=`--${o}`),s}var n=class{constructor(t,r){e(this,"block",void 0),e(this,"namespace",void 0),this.block=t,this.namespace=r||"gct"}b(t=""){return r(this.namespace,this.block,t,"","")}e(t){return t?r(this.namespace,this.block,"",t,""):""}m(t){return t?r(this.namespace,this.block,"","",t):""}be(t,e){return t&&e?r(this.namespace,this.block,t,e,""):""}em(t,e){return t&&e?r(this.namespace,this.block,"",t,e):""}bm(t,e){return t&&e?r(this.namespace,this.block,t,"",e):""}bem(t,e,n){return t&&e&&n?r(this.namespace,this.block,t,e,n):""}is(t,e){return t&&e?`is-${t}`:""}cssVar(t){const e={};for(const r in t)t[r]&&(e[this.cssVarName(r)]=t[r]);return e}cssVarBlock(t){const e={};for(const r in t)t[r]&&(e[this.cssVarBlockName(r)]=t[r]);return e}cssVarName(t){return`--${this.namespace}-${t}`}cssVarBlockName(t){return`--${this.namespace}-${this.block}-${t}`}};function o(t){return new n(t)}export{n as Namespace,o as useNamespace};
@@ -24,6 +24,36 @@ This document outlines all design tokens available in the light theme.
24
24
  | `--gct--blue-11` | RGB(1, 60, 114) |
25
25
  | `--gct--blue-12` | RGB(1, 48, 90) |
26
26
 
27
+ #### Runtime Theme Color (Light)
28
+
29
+ Light theme supports two pre-defined primary palettes, switched via CSS class on `html`:
30
+
31
+ | `themeSetting.themeColor` | Class on `html` | Blue-8 (Primary) |
32
+ |---------------------------|-----------------|------------------|
33
+ | `#026AC8` (default) | _(none)_ | RGB(2, 106, 200) |
34
+ | `#0DAA9C` | `theme-color-teal` | RGB(13, 170, 156) |
35
+
36
+ When `theme-color-teal` is present on `.light` / `.light-theme`, only `--gct-blue-1` through `--gct-blue-12` are overridden. Semantic tokens (`--gct-color-primary`, info, link, border hover/active) cascade automatically.
37
+
38
+ **Teal palette** (`theme-color-teal`):
39
+
40
+ | Token | Value |
41
+ |-------|-------|
42
+ | `--gct--blue-1` | RGB(248, 252, 252) |
43
+ | `--gct--blue-2` | RGB(233, 247, 246) |
44
+ | `--gct--blue-3` | RGB(211, 240, 237) |
45
+ | `--gct--blue-4` | RGB(207, 238, 235) |
46
+ | `--gct--blue-5` | RGB(170, 225, 220) |
47
+ | `--gct--blue-6` | RGB(134, 213, 206) |
48
+ | `--gct--blue-7` | RGB(66, 189, 178) |
49
+ | `--gct--blue-8` | RGB(13, 170, 156) |
50
+ | `--gct--blue-9` | RGB(12, 156, 144) |
51
+ | `--gct--blue-10` | RGB(11, 139, 128) |
52
+ | `--gct--blue-11` | RGB(9, 122, 112) |
53
+ | `--gct--blue-12` | RGB(8, 109, 100) |
54
+
55
+ Switching is handled by `useThemeSetting` in `@gct-paas/core` — set `themeSetting.themeColor` to one of `THEME_COLORS` (`#026AC8` | `#0DAA9C`).
56
+
27
57
  ### Red (Danger)
28
58
  | Token | Value |
29
59
  |-------|-------|
package/es/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { Namespace } from "./utils/namespace/namespace.mjs";
2
- export { Namespace };
1
+ import { Namespace, useNamespace } from "./utils/namespace/namespace.mjs";
2
+ export { Namespace, useNamespace };
@@ -1 +1 @@
1
- export { Namespace } from './namespace/namespace';
1
+ export { Namespace, useNamespace } from './namespace/namespace';
@@ -115,3 +115,11 @@ export declare class Namespace {
115
115
  */
116
116
  cssVarBlockName(name: string): string;
117
117
  }
118
+ /**
119
+ * 获取 bem 操作类
120
+ *
121
+ * @export
122
+ * @param {string} block
123
+ * @return {*} {Namespace}
124
+ */
125
+ export declare function useNamespace(block: string): Namespace;
@@ -28,6 +28,7 @@ function _bem(namespace, block, blockSuffix, element, modifier) {
28
28
  * @class Namespace
29
29
  */
30
30
  var Namespace = class {
31
+ block;
31
32
  /**
32
33
  * 命名空间
33
34
  *
@@ -167,5 +168,15 @@ var Namespace = class {
167
168
  return `--${this.namespace}-${this.block}-${name}`;
168
169
  }
169
170
  };
171
+ /**
172
+ * 获取 bem 操作类
173
+ *
174
+ * @export
175
+ * @param {string} block
176
+ * @return {*} {Namespace}
177
+ */
178
+ function useNamespace(block) {
179
+ return new Namespace(block);
180
+ }
170
181
  //#endregion
171
- export { Namespace };
182
+ export { Namespace, useNamespace };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/scss",
3
- "version": "0.1.6-dev.3",
3
+ "version": "0.1.6-dev.30",
4
4
  "type": "module",
5
5
  "loader": "dist/index.esm.min.js",
6
6
  "description": "paas 平台样式框架包",
@@ -0,0 +1,13 @@
1
+ .light {
2
+ .ant-btn-success {
3
+ color: var(--gct-color-success);
4
+ }
5
+
6
+ .ant-btn-error {
7
+ color: var(--gct-color-danger);
8
+ }
9
+
10
+ .ant-btn-warning {
11
+ color: var(--gct-color-warning);
12
+ }
13
+ }
@@ -0,0 +1,78 @@
1
+ // ! nprogress 样式
2
+
3
+ /* Make clicks pass-through */
4
+ #nprogress {
5
+ pointer-events: none;
6
+ }
7
+
8
+ #nprogress .bar {
9
+ position: fixed;
10
+ top: 0;
11
+ left: 0;
12
+ z-index: 1031;
13
+ width: 100%;
14
+ height: 2px;
15
+ background: #29d;
16
+ }
17
+
18
+ /* Fancy blur effect */
19
+ #nprogress .peg {
20
+ position: absolute;
21
+ right: 0;
22
+ display: block;
23
+ width: 100px;
24
+ height: 100%;
25
+ box-shadow: 0 0 10px #29d, 0 0 5px #29d;
26
+ opacity: 1.0;
27
+ transform: rotate(3deg) translate(0, -4px);
28
+ }
29
+
30
+ /* Remove these to get rid of the spinner */
31
+ #nprogress .spinner {
32
+ position: fixed;
33
+ top: 15px;
34
+ right: 15px;
35
+ z-index: 1031;
36
+ display: block;
37
+ }
38
+
39
+ #nprogress .spinner-icon {
40
+ box-sizing: border-box;
41
+ width: 18px;
42
+ height: 18px;
43
+ border: solid 2px transparent;
44
+ border-top-color: #29d;
45
+ border-left-color: #29d;
46
+ border-radius: 50%;
47
+ animation: nprogress-spinner 400ms linear infinite;
48
+ }
49
+
50
+ .nprogress-custom-parent {
51
+ position: relative;
52
+ overflow: hidden;
53
+ }
54
+
55
+ .nprogress-custom-parent #nprogress .spinner,
56
+ .nprogress-custom-parent #nprogress .bar {
57
+ position: absolute;
58
+ }
59
+
60
+ @keyframes nprogress-spinner {
61
+ 0% { transform: rotate(0deg); }
62
+ 100% { transform: rotate(360deg); }
63
+ }
64
+
65
+ @keyframes nprogress-spinner {
66
+ 0% { transform: rotate(0deg); }
67
+ 100% { transform: rotate(360deg); }
68
+ }
69
+
70
+ // ! nprogress 样式 End
71
+
72
+ body.color-weak {
73
+ filter: invert(80%);
74
+ }
75
+
76
+ body.gray-mode {
77
+ filter: grayscale(100%);
78
+ }
@@ -1,3 +1,5 @@
1
1
  /** 重置标准化样式、框大小定义等,例如 normalize.css、reset.css **/
2
- @forward './ant-design-vue';
3
2
  @forward './reset';
3
+ @forward './base';
4
+ @forward './antv';
5
+ @forward './vant';
@@ -0,0 +1,14 @@
1
+ :root {
2
+ --van-button-primary-color: var(--van-white);
3
+ --van-button-primary-background: var(--gct-color-primary);
4
+ --van-primary-color: var(--gct-color-primary);
5
+ --van-radio-checked-icon-color: var(--gct-color-primary);
6
+ --van-checkbox-checked-icon-color: var(--gct-color-primary);
7
+ --van-switch-on-background: var(--gct-color-primary);
8
+ }
9
+
10
+ .van-cell {
11
+ --van-cell-background: transparent;
12
+ --van-cell-group-background: transparent;
13
+ --van-cell-horizontal-padding: 0;
14
+ }
@@ -1,6 +1,6 @@
1
1
  @use '../../global.scss' as *;
2
2
 
3
- :root.dark, .dark-theme {
3
+ .dark, .dark-theme {
4
4
  // 主色
5
5
  #{getCssVarName(blue, 1)}: 246, 248, 254;
6
6
  #{getCssVarName(blue, 2)}: 236, 242, 253;
@@ -0,0 +1,33 @@
1
+ @use '../../global.scss' as *;
2
+
3
+ // 默认主色 #026AC8
4
+ @mixin blue-palette-blue {
5
+ #{getCssVarName(blue, 1)}: 246, 250, 253;
6
+ #{getCssVarName(blue, 2)}: 226, 238, 249;
7
+ #{getCssVarName(blue, 3)}: 200, 223, 243;
8
+ #{getCssVarName(blue, 4)}: 191, 216, 242;
9
+ #{getCssVarName(blue, 5)}: 144, 187, 233;
10
+ #{getCssVarName(blue, 6)}: 91, 156, 225;
11
+ #{getCssVarName(blue, 7)}: 48, 126, 210;
12
+ #{getCssVarName(blue, 8)}: 2, 106, 200;
13
+ #{getCssVarName(blue, 9)}: 2, 90, 170;
14
+ #{getCssVarName(blue, 10)}: 1, 75, 142;
15
+ #{getCssVarName(blue, 11)}: 1, 60, 114;
16
+ #{getCssVarName(blue, 12)}: 1, 48, 90;
17
+ }
18
+
19
+ // 青绿主色 #0DAA9C
20
+ @mixin blue-palette-teal {
21
+ #{getCssVarName(blue, 1)}: 248, 252, 252;
22
+ #{getCssVarName(blue, 2)}: 233, 247, 246;
23
+ #{getCssVarName(blue, 3)}: 211, 240, 237;
24
+ #{getCssVarName(blue, 4)}: 207, 238, 235;
25
+ #{getCssVarName(blue, 5)}: 170, 225, 220;
26
+ #{getCssVarName(blue, 6)}: 134, 213, 206;
27
+ #{getCssVarName(blue, 7)}: 66, 189, 178;
28
+ #{getCssVarName(blue, 8)}: 13, 170, 156;
29
+ #{getCssVarName(blue, 9)}: 12, 156, 144;
30
+ #{getCssVarName(blue, 10)}: 11, 139, 128;
31
+ #{getCssVarName(blue, 11)}: 9, 122, 112;
32
+ #{getCssVarName(blue, 12)}: 8, 109, 100;
33
+ }
@@ -1,22 +1,11 @@
1
1
  @use '../../global.scss' as *;
2
+ @use './blue-palettes' as *;
2
3
 
3
- :root.light, .light-theme {
4
+ .light, .light-theme {
4
5
  #{getCssVarName(color, white)}: white;
5
6
  #{getCssVarName(color, black)}: black;
6
7
 
7
- // 主色
8
- #{getCssVarName(blue, 1)}: 246, 250, 253;
9
- #{getCssVarName(blue, 2)}: 226, 238, 249;
10
- #{getCssVarName(blue, 3)}: 200, 223, 243;
11
- #{getCssVarName(blue, 4)}: 191, 216, 242;
12
- #{getCssVarName(blue, 5)}: 144, 187, 233;
13
- #{getCssVarName(blue, 6)}: 91, 156, 225;
14
- #{getCssVarName(blue, 7)}: 48, 126, 210;
15
- #{getCssVarName(blue, 8)}: 2, 106, 200;
16
- #{getCssVarName(blue, 9)}: 2, 90, 170;
17
- #{getCssVarName(blue, 10)}: 1, 75, 142;
18
- #{getCssVarName(blue, 11)}: 1, 60, 114;
19
- #{getCssVarName(blue, 12)}: 1, 48, 90;
8
+ @include blue-palette-blue;
20
9
 
21
10
  // 危险色
22
11
  #{getCssVarName(red, 1)}: 254, 236, 221;
@@ -280,3 +269,8 @@
280
269
  #{getCssVarName(z-index, l)}: 2000;
281
270
  #{getCssVarName(z-index, xl)}: 9999;
282
271
  }
272
+
273
+ .light.theme-color-teal,
274
+ .light-theme.theme-color-teal {
275
+ @include blue-palette-teal;
276
+ }
@@ -1,302 +0,0 @@
1
- // 用于重置覆盖 ant-design-vue 的样式
2
- :root.light {
3
- --ant-primary-color: var(--gct-color-primary);
4
- --ant-primary-color-hover: var(--gct-color-primary-hover);
5
- --ant-primary-color-active: var(--gct-color-primary-active);
6
- }
7
-
8
-
9
- input:-webkit-autofill {
10
- box-shadow: 0 0 0 1000px white inset !important;
11
- }
12
-
13
- :-webkit-autofill {
14
- transition: background-color 5000s ease-in-out 0s !important;
15
- }
16
-
17
- html {
18
- overflow: hidden;
19
- text-size-adjust: 100%;
20
- }
21
-
22
- html,
23
- body {
24
- width: 100%;
25
- height: 100%;
26
- overflow: visible;
27
- overflow-x: hidden;
28
- overscroll-behavior: none;
29
-
30
- // overflow: hidden;
31
-
32
- &.color-weak {
33
- filter: invert(80%);
34
- }
35
-
36
- &.gray-mode {
37
- filter: grayscale(100%);
38
- filter: progid:dximagetransform.microsoft.basicimage(grayscale=1);
39
- }
40
-
41
- .copy-main {
42
- box-sizing: border-box;
43
- overflow: hidden;
44
- text-overflow: ellipsis;
45
- word-break: break-all; /* 任意字符处都可换行(包括单词中间) */
46
- overflow-wrap: break-word; /* 允许在单词内换行 */
47
- outline: none;
48
- background-color: #fff;
49
-
50
- // display: table;
51
- border: 1px dashed #e8ebf0;
52
-
53
- .copy-rich-text {
54
- box-sizing: border-box;
55
- width: 100%;
56
- height: 100%;
57
- overflow: hidden;
58
- word-break: break-all; /* 任意字符处都可换行(包括单词中间) */
59
- overflow-wrap: break-word; /* 允许在单词内换行 */
60
-
61
- span {
62
- line-height: 1;
63
- }
64
-
65
- p {
66
- margin-bottom: 12px;
67
- font-size: 12px;
68
- }
69
- }
70
- }
71
- }
72
-
73
- #app {
74
- overflow: auto;
75
-
76
- & > *:not(.is-empty-page) {
77
- min-width: 1280px;
78
- }
79
- }
80
-
81
- a:focus,
82
- a:active,
83
- button,
84
- div,
85
- svg,
86
- /* stylelint-disable-next-line no-descending-specificity */
87
- span {
88
- outline: none;
89
- }
90
-
91
- .primary-gct {
92
- color: #{getCssVar(color-primary)} !important;
93
- }
94
-
95
- .warning-gct {
96
- color: #{getCssVar(color-warning)} !important;
97
- }
98
-
99
- .error-gct {
100
- color: #{getCssVar(color-error)} !important;
101
- }
102
-
103
- .success-gct {
104
- color: #{getCssVar(color-success)} !important;
105
- }
106
-
107
- .primary-gct-hover:hover {
108
- color: #{getCssVar(color-primary)} !important;
109
- }
110
-
111
- .warning-gct-hover:hover {
112
- color: #{getCssVar(color-warning)} !important;
113
- }
114
-
115
- .error-gct-hover:hover {
116
- color: #{getCssVar(color-error)} !important;
117
- }
118
-
119
- .success-gct-hover:hover {
120
- color: #{getCssVar(color-success)} !important;
121
- }
122
-
123
- .box-full {
124
- width: 100%;
125
- height: 100%;
126
- }
127
-
128
- .gct-divider__vertical {
129
- display: inline-block;
130
- height: var(--size, 14px);
131
- margin-right: var(--space-r, 12px);
132
- margin-left: var(--space-l, 12px);
133
- border-left: 1px solid var(--color, #eaeaea);
134
- }
135
-
136
- // css描述 覆盖antd样式
137
- // tab组件左上方间距
138
- .ant-tabs.--tl-space {
139
- .ant-tabs-nav {
140
- padding-left: 24px;
141
- }
142
- }
143
-
144
- // //拖拽样式
145
- .drawing-chosen {
146
- background-color: rgb(13 170 156 / 10%) !important;
147
- }
148
-
149
- .simple-upload-model.ant-modal {
150
- .ant-modal-header {
151
- padding-right: 50px;
152
- }
153
- }
154
-
155
- .gct-text-overflow {
156
- overflow: hidden;
157
- text-overflow: ellipsis;
158
- word-break: break-all;
159
- white-space: nowrap;
160
- }
161
-
162
- a[danger] {
163
- color: var(--ant-error-color);
164
- }
165
-
166
- // textarea关闭resize,数字提示位置调整
167
- div.ant-input-textarea.ant-input-textarea-show-count {
168
- position: relative;
169
-
170
- textarea {
171
- resize: none;
172
- }
173
-
174
- &.ant-input-textarea-show-count::after {
175
- position: absolute;
176
- right: 12px;
177
- bottom: 1px;
178
- margin: 0;
179
- }
180
- }
181
-
182
- // 修改组件默认圆角大小
183
- button.ant-btn,
184
- span.ant-input-affix-wrapper,
185
- textarea.ant-input,
186
- div.ant-input-number,
187
- div.ant-select:not(.ant-select-customize-input) .ant-select-selector,
188
- div.ant-picker,
189
- div.ant-input-number-group-addon {
190
- border-radius: 4px;
191
- }
192
-
193
- input.ant-input {
194
- border-radius: 0;
195
- }
196
-
197
- .ant-input-group.ant-input-group-compact > .ant-select:first-child > div.ant-select-selector,
198
- span.ant-input-group.ant-input-group-compact > :first-child,
199
- span.ant-input-group-addon {
200
- border-top-left-radius: 4px;
201
- border-bottom-left-radius: 4px;
202
- }
203
-
204
- span.ant-input-group.ant-input-group-compact > :last-child,
205
- span.ant-input-group-addon:last-child {
206
- border-top-right-radius: 4px;
207
- border-bottom-right-radius: 4px;
208
- }
209
-
210
- .gct-number-input {
211
- &.ant-input-number {
212
- border-right-width: 0;
213
-
214
- &:hover {
215
- border-right-width: 1px;
216
- }
217
- }
218
-
219
- .ant-input-number-group-addon {
220
- font-size: 14px;
221
- background-color: #fff;
222
- }
223
- }
224
-
225
- .gct-edhr-table {
226
- .ant-spin-nested-loading > div > .ant-spin {
227
- max-height: 100%;
228
- }
229
- }
230
-
231
- .gct-edhr-auto-size-table {
232
- position: relative;
233
- height: 100%;
234
- overflow: hidden;
235
-
236
- .ant-spin-nested-loading {
237
- position: absolute;
238
- inset: 0;
239
- height: 100%;
240
- overflow: hidden;
241
-
242
- .ant-spin-container {
243
- display: flex;
244
- flex-direction: column;
245
- justify-content: space-between;
246
- width: 100%;
247
- height: 100%;
248
- overflow: hidden;
249
-
250
- .ant-table {
251
- flex: 1;
252
- overflow: hidden;
253
- }
254
-
255
- .ant-table-container {
256
- display: flex;
257
- flex-direction: column;
258
- height: 100%;
259
- overflow: hidden;
260
-
261
- .ant-table-body {
262
- flex: 1;
263
-
264
- // overflow: auto !important;
265
- }
266
- }
267
- }
268
- }
269
- }
270
-
271
- .gct-edhr-pagination {
272
- .ant-pagination.ant-table-pagination {
273
- margin-bottom: 0;
274
- }
275
- }
276
-
277
- /* stylelint-disable-next-line no-descending-specificity */
278
- .ant-table {
279
- color: #212528;
280
- }
281
-
282
- .gct-border-dashed {
283
- border: 2px dashed #dbdbdb;
284
- }
285
-
286
- // 无界应用内的 vue-devtools 容器隐藏
287
- .wujie-sub-app {
288
- /* stylelint-disable-next-line selector-id-pattern */
289
- #__vue-devtools-container__ {
290
- display: none !important;
291
- }
292
- }
293
-
294
- .ant-radio {
295
- .ant-radio-inner {
296
- border-color: var(--gct-color-border);
297
- }
298
- }
299
-
300
- .is-hidden {
301
- display: none !important;
302
- }