File tree Expand file tree Collapse file tree 2 files changed +51
-9
lines changed Expand file tree Collapse file tree 2 files changed +51
-9
lines changed Original file line number Diff line number Diff line change 77
77
flex : 1 ;
78
78
display : flex ;
79
79
flex-direction : column ;
80
- gap : v .$spacing-xl ; // 增加到24px的间距
81
80
padding-right : v .$spacing-lg ;
81
+ // 移除固定的 gap 值
82
+ justify-content : flex-start ; // 从顶部开始排列
82
83
83
84
button {
84
85
width : 100% ;
85
86
height : v .$button-size-md ;
86
- padding : 0 v .$spacing-xl ; // 增加左右内边距
87
+ padding : 0 v .$spacing-xl ;
87
88
font-size : v .$font-sm ;
88
89
color : var (--el-text-color-regular );
89
90
background-color : var (--el-fill-color-light );
94
95
overflow : hidden ;
95
96
text-overflow : ellipsis ;
96
97
text-align : left ;
97
- margin : 6 px 0 ; // 增加到6px的外边距
98
+ margin : v . $spacing-xs 0 ; // 减小按钮之间的间距
98
99
99
100
& :hover {
100
101
color : var (--el-color-primary );
113
114
114
115
@media (hover : none ) and (pointer : coarse) {
115
116
min-height : 48px ; // 增加移动端按钮高度
116
- margin : 4 px 0 ;
117
+ margin : v . $spacing-xs 0 ;
117
118
118
119
& :active {
119
120
background-color : var (--el-color-primary-light-8 );
Original file line number Diff line number Diff line change 12
12
transition : all 0.3s ease ;
13
13
margin-top : v .$spacing-xs ;
14
14
15
+ & :not (.horizontal-layout ) {
16
+ .variables-section {
17
+ // 竖直布局时使用自适应高度
18
+ height : auto ;
19
+ min-height : 120px ; // 设置最小高度
20
+ max-height : 320px ; // 设置最大高度
21
+ margin-bottom : v .$spacing-md ; // 添加底部间距
22
+ }
23
+
24
+ :deep (.calculator ) {
25
+ margin-top : 0 ; // 移除计算器顶部边距
26
+ width : 100% ; // 确保计算器宽度占满
27
+ max-width : 320px ; // 保持最大宽度限制
28
+ }
29
+ }
30
+
15
31
& .horizontal-layout {
16
32
flex-direction : row ;
17
33
justify-content : center ;
90
106
width : 100% ;
91
107
max-width : 320px ;
92
108
}
109
+
110
+ .variables {
111
+ position : relative ;
112
+ flex : 1 ;
113
+ overflow : hidden ;
114
+ display : flex ;
115
+ flex-direction : column ;
116
+
117
+ :deep (.el-scrollbar ) {
118
+ min-height : 80px ; // 设置最小高度
119
+ height : auto ; // 自适应高度
120
+ max-height : calc (100% - 48px ); // 减去搜索框高度
121
+ }
122
+ }
93
123
}
94
124
95
125
:deep(.calculator ) {
131
161
132
162
.el-scrollbar__wrap {
133
163
overflow-x : hidden ;
164
+ // 当内容高度小于容器高度时隐藏滚动条
165
+ & :not (:hover ):not (:focus-within ) {
166
+ scrollbar-width : none ;
167
+ & ::-webkit-scrollbar {
168
+ width : 0 ;
169
+ height : 0 ;
170
+ }
171
+ }
134
172
}
135
173
136
174
.el-scrollbar__view {
137
- padding : v .$spacing-md ;
175
+ padding : v .$spacing-md v . $spacing-md v . $spacing-xs ; // 调整内边距,底部稍小
138
176
display : flex ;
139
177
flex-direction : column ;
140
- gap : v .$spacing-xs ;
141
-
142
- button {
143
- margin-right : v .$spacing-xs ; // 确保按钮右边有足够空间显示边框
178
+ // 当按钮少时,调整间距
179
+ & :only-child {
180
+ gap : v .$spacing-xs ;
181
+ }
182
+ // 当按钮多时,保持原有间距
183
+ & :not (:only-child ) {
184
+ gap : v .$spacing-xs ;
144
185
}
145
186
}
146
187
}
You can’t perform that action at this time.
0 commit comments