@ew-color-picker/style 2.0.9 → 2.0.11

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.
@@ -4,8 +4,8 @@ $prefix: "ew-" !default;
4
4
  .#{$prefix}input-number {
5
5
  display: flex;
6
6
  align-items: stretch;
7
- border: 1.5px solid #d9d9d9;
8
- border-radius: 8px;
7
+ border: var(--input-number-border-width, 1.5px) solid #d9d9d9;
8
+ border-radius: var(--input-number-radius, 8px);
9
9
  background: #fff;
10
10
  overflow: hidden;
11
11
  width: 100%;
@@ -14,7 +14,7 @@ $prefix: "ew-" !default;
14
14
  max-width: none;
15
15
  box-sizing: border-box;
16
16
  transition: border-color 0.2s;
17
- height: 32px; /* 统一高度 */
17
+ height: var(--input-number-height, 32px);
18
18
  }
19
19
  .#{$prefix}input-number:focus-within {
20
20
  border-color: #4096ef;
@@ -23,25 +23,27 @@ $prefix: "ew-" !default;
23
23
  flex: 1;
24
24
  border: none;
25
25
  outline: none;
26
- padding: 4px 10px;
27
- font-size: 14px;
26
+ padding: var(--input-number-input-padding, 4px 10px);
27
+ font-size: var(--input-number-input-font-size, 14px);
28
28
  background: transparent;
29
29
  min-width: 0;
30
- height: 100%; /* 继承父容器高度 */
30
+ height: 100%;
31
31
  box-sizing: border-box;
32
32
  color: #222;
33
33
  font-family: inherit;
34
+ line-height: 1;
34
35
  }
35
36
  .#{$prefix}input-number__buttons {
36
- width: 32px;
37
- min-width: 24px;
37
+ width: var(--input-number-buttons-width, 32px);
38
+ min-width: var(--input-number-buttons-min-width, 24px);
38
39
  display: flex;
39
40
  flex-direction: column;
40
41
  background: #fff;
41
- height: 100%; /* 继承父容器高度 */
42
+ height: 100%;
42
43
  padding: 0;
43
44
  margin: 0;
44
- border-left: 1px solid #e5e6eb;
45
+ border-left: var(--input-number-border-width, 1.5px) solid #e5e6eb;
46
+ flex-shrink: 0;
45
47
  }
46
48
  .#{$prefix}input-number__button {
47
49
  display: flex;
@@ -66,10 +68,10 @@ $prefix: "ew-" !default;
66
68
  background: #f0f8ff;
67
69
  }
68
70
  .#{$prefix}input-number__icon {
69
- width: 10px;
70
- height: 10px;
71
- flex: 0 0 10px;
71
+ width: var(--input-number-icon-size, 10px);
72
+ height: var(--input-number-icon-size, 10px);
73
+ flex: 0 0 var(--input-number-icon-size, 10px);
72
74
  display: block;
73
75
  margin: 0 auto;
74
76
  pointer-events: none;
75
- }
77
+ }
package/src/select.scss CHANGED
@@ -15,16 +15,16 @@ $prefix: "ew-" !default;
15
15
  display: flex;
16
16
  align-items: center;
17
17
  justify-content: space-between;
18
- gap: 6px;
18
+ gap: 4px;
19
19
  width: 100%;
20
- height: 32px;
21
- padding: 0 10px;
22
- border: 1.5px solid #d9d9d9;
23
- border-radius: 8px;
20
+ height: var(--select-height, 32px);
21
+ padding: var(--select-padding, 0 10px);
22
+ border: var(--select-border-width, 1.5px) solid #d9d9d9;
23
+ border-radius: var(--select-radius, 8px);
24
24
  background: #fff;
25
25
  color: #222;
26
26
  font-family: inherit;
27
- font-size: 14px;
27
+ font-size: var(--select-font-size, 14px);
28
28
  line-height: 1;
29
29
  text-align: left;
30
30
  cursor: pointer;
@@ -57,9 +57,9 @@ $prefix: "ew-" !default;
57
57
  display: inline-flex;
58
58
  align-items: center;
59
59
  justify-content: center;
60
- flex: 0 0 12px;
61
- width: 12px;
62
- height: 12px;
60
+ flex: 0 0 var(--select-clear-size, 12px);
61
+ width: var(--select-clear-size, 12px);
62
+ height: var(--select-clear-size, 12px);
63
63
  color: #999;
64
64
  border-radius: 50%;
65
65
  cursor: pointer;
@@ -76,8 +76,8 @@ $prefix: "ew-" !default;
76
76
 
77
77
  .#{$prefix}select__clear-icon {
78
78
  display: block;
79
- width: 12px;
80
- height: 12px;
79
+ width: var(--select-clear-size, 12px);
80
+ height: var(--select-clear-size, 12px);
81
81
  pointer-events: none;
82
82
  }
83
83
 
@@ -85,9 +85,9 @@ $prefix: "ew-" !default;
85
85
  display: flex;
86
86
  align-items: center;
87
87
  justify-content: center;
88
- flex: 0 0 12px;
89
- width: 12px;
90
- height: 12px;
88
+ flex: 0 0 var(--select-arrow-size, 12px);
89
+ width: var(--select-arrow-size, 12px);
90
+ height: var(--select-arrow-size, 12px);
91
91
  color: #999;
92
92
  transition: transform 0.2s;
93
93
  }
@@ -98,8 +98,8 @@ $prefix: "ew-" !default;
98
98
 
99
99
  .#{$prefix}select__arrow-icon {
100
100
  display: block;
101
- width: 12px;
102
- height: 12px;
101
+ width: var(--select-arrow-size, 12px);
102
+ height: var(--select-arrow-size, 12px);
103
103
  pointer-events: none;
104
104
  }
105
105
 
@@ -0,0 +1,98 @@
1
+ @import './variable.scss';
2
+ // 类名前缀,可通过 @use ... with ($prefix: "my-") 自定义,需与 JS 侧 prefix 选项保持一致
3
+ $prefix: "ew-" !default;
4
+
5
+ // 悬浮提示(供 Select / Checkbox / Gradient 等复用,能力对齐 el-tooltip)
6
+ .#{$prefix}tooltip {
7
+ position: fixed;
8
+ z-index: 3000;
9
+ box-sizing: border-box;
10
+ max-width: var(--ew-tooltip-max-width, none);
11
+ padding: 5px 10px;
12
+ border-radius: 4px;
13
+ font-family: inherit;
14
+ font-size: 12px;
15
+ line-height: 1.4;
16
+ text-align: left;
17
+ word-break: break-word;
18
+ pointer-events: none;
19
+ opacity: 0;
20
+ visibility: hidden;
21
+ transition: opacity 0.2s ease, visibility 0.2s ease;
22
+ }
23
+
24
+ // 主题:dark(默认)
25
+ .#{$prefix}tooltip--dark {
26
+ --ew-tooltip-bg: #303133;
27
+ --ew-tooltip-color: #fff;
28
+ --ew-tooltip-border-color: transparent;
29
+ --ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
30
+ }
31
+
32
+ // 主题:light
33
+ .#{$prefix}tooltip--light {
34
+ --ew-tooltip-bg: #fff;
35
+ --ew-tooltip-color: #303133;
36
+ --ew-tooltip-border-color: #e4e7ed;
37
+ --ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
38
+ }
39
+
40
+ .#{$prefix}tooltip--dark,
41
+ .#{$prefix}tooltip--light {
42
+ background: var(--ew-tooltip-bg);
43
+ color: var(--ew-tooltip-color);
44
+ border: 1px solid var(--ew-tooltip-border-color);
45
+ box-shadow: var(--ew-tooltip-shadow);
46
+ }
47
+
48
+ .#{$prefix}tooltip--visible {
49
+ opacity: 1;
50
+ visibility: visible;
51
+ }
52
+
53
+ // enterable:允许鼠标移入浮层内容
54
+ .#{$prefix}tooltip--enterable {
55
+ pointer-events: auto;
56
+ }
57
+
58
+ .#{$prefix}tooltip__content {
59
+ display: block;
60
+ }
61
+
62
+ // 箭头:旋转方块,只给朝向视口外侧的两条边描边,内侧与浮层背景重合
63
+ .#{$prefix}tooltip__arrow {
64
+ position: absolute;
65
+ width: 8px;
66
+ height: 8px;
67
+ box-sizing: border-box;
68
+ background: inherit;
69
+ border: 1px solid transparent;
70
+ border-color: transparent;
71
+ transform: rotate(45deg);
72
+ pointer-events: none;
73
+ z-index: -1;
74
+ }
75
+
76
+ // 浮层在上方,箭头朝下:可见边为原始 right + bottom
77
+ .#{$prefix}tooltip[data-placement^="top"] .#{$prefix}tooltip__arrow {
78
+ border-right-color: var(--ew-tooltip-border-color);
79
+ border-bottom-color: var(--ew-tooltip-border-color);
80
+ }
81
+
82
+ // 浮层在下方,箭头朝上:可见边为原始 left + top
83
+ .#{$prefix}tooltip[data-placement^="bottom"] .#{$prefix}tooltip__arrow {
84
+ border-left-color: var(--ew-tooltip-border-color);
85
+ border-top-color: var(--ew-tooltip-border-color);
86
+ }
87
+
88
+ // 浮层在左侧,箭头朝右:可见边为原始 top + right
89
+ .#{$prefix}tooltip[data-placement^="left"] .#{$prefix}tooltip__arrow {
90
+ border-top-color: var(--ew-tooltip-border-color);
91
+ border-right-color: var(--ew-tooltip-border-color);
92
+ }
93
+
94
+ // 浮层在右侧,箭头朝左:可见边为原始 left + bottom
95
+ .#{$prefix}tooltip[data-placement^="right"] .#{$prefix}tooltip__arrow {
96
+ border-left-color: var(--ew-tooltip-border-color);
97
+ border-bottom-color: var(--ew-tooltip-border-color);
98
+ }