|
175 | 175 | background-color: var(--tv-Button-bg-color-disabled);
|
176 | 176 | border-color: var(--tv-Button-border-color-disabled);
|
177 | 177 | fill: var(--tv-Button-icon-color-disabled);
|
| 178 | + cursor: not-allowed; |
178 | 179 | }
|
179 | 180 |
|
180 |
| - /** 4、图标场景 */ |
| 181 | + /** 4、图标 + 文字场景 */ |
181 | 182 |
|
182 |
| - /** 7、其他场景 */ |
| 183 | + // 仅图标有边框时,高宽都按尺寸的高度 |
| 184 | + .size-only-icon-mixin(@size) { |
| 185 | + @wh: %('var(--tv-Button-height%a)', @size); |
| 186 | + |
| 187 | + width: e(@wh); |
| 188 | + height: e(@wh); |
| 189 | + min-width: e(@wh); |
| 190 | + min-height: e(@wh); |
| 191 | + } |
| 192 | + |
| 193 | + // 仅图标无边框时,icon的高宽都按尺寸的高度。 根据设计稿,这里有4像素的padding |
| 194 | + .size-only-icon-ontext-iconsize-mixin(@size) { |
| 195 | + @wh: %('calc( var(--tv-Button-height%a) - 8px)', @size); |
| 196 | + |
| 197 | + font-size: e(@wh); |
| 198 | + } |
| 199 | + |
| 200 | + // 默认图标场景: icon-size 随着尺寸的font-size而变化。 |
| 201 | + .tiny-svg { |
| 202 | + vertical-align: text-top; //居中 |
| 203 | + } |
| 204 | + |
| 205 | + // 仅图标场景 |
| 206 | + &.is-only-icon.is-only-icon { |
| 207 | + // 只有default主题的边框色和 hover 边框色 是和主题色相反的。其它都随主题的色。 |
| 208 | + // 仅图标的plain场景,无对应示例,不处理。 |
| 209 | + &.@{button-prefix-cls}--default { |
| 210 | + border-color: var(--tv-Button-border-color-only-icon-default); |
| 211 | + |
| 212 | + &:active, |
| 213 | + &:focus, |
| 214 | + &:hover, |
| 215 | + &.is-active { |
| 216 | + border-color: var(--tv-Button-border-color-only-icon-default-hover); |
| 217 | + } |
| 218 | + } |
| 219 | + |
| 220 | + padding: 0; //不需要padding |
| 221 | + |
| 222 | + .size-only-icon-mixin(e('')); // 不同尺寸时,大小不同 |
| 223 | + |
| 224 | + &.@{button-prefix-cls}--large { |
| 225 | + .size-only-icon-mixin(-large); |
| 226 | + } |
| 227 | + &.@{button-prefix-cls}--medium { |
| 228 | + .size-only-icon-mixin(-medium); |
| 229 | + } |
| 230 | + &.@{button-prefix-cls}--small { |
| 231 | + .size-only-icon-mixin(-small); |
| 232 | + } |
| 233 | + &.@{button-prefix-cls}--mini { |
| 234 | + .size-only-icon-mixin(-mini); |
| 235 | + } |
| 236 | + |
| 237 | + &:not(.is-circle) { |
| 238 | + border-radius: var(--tv-Button-border-radius-only-icon); |
| 239 | + } |
| 240 | + |
| 241 | + // 无边框时: 图标大小为button的大小的高度 |
| 242 | + &.@{button-prefix-cls}--text { |
| 243 | + border: none; |
| 244 | + border-radius: var(--tv-Button-border-radius-only-icon-ontext); // 影响hover时的阴影 |
| 245 | + |
| 246 | + background-color: var(--tv-Button-bg-color-only-icon-ontext); |
| 247 | + |
| 248 | + &:active, |
| 249 | + &:focus, |
| 250 | + &:hover, |
| 251 | + &.is-active { |
| 252 | + background-color: var(--tv-Button-bg-color-only-icon-ontext-hover); |
| 253 | + } |
| 254 | + // 不同的尺寸,icon大小 为高度。 原型稿不包含 |
| 255 | + .size-only-icon-ontext-iconsize-mixin(e('')); |
| 256 | + |
| 257 | + &.@{button-prefix-cls}--large { |
| 258 | + .size-only-icon-ontext-iconsize-mixin(-large); |
| 259 | + } |
| 260 | + &.@{button-prefix-cls}--medium { |
| 261 | + .size-only-icon-ontext-iconsize-mixin(-medium); |
| 262 | + } |
| 263 | + &.@{button-prefix-cls}--small { |
| 264 | + .size-only-icon-ontext-iconsize-mixin(-small); |
| 265 | + } |
| 266 | + &.@{button-prefix-cls}--mini { |
| 267 | + .size-only-icon-ontext-iconsize-mixin(-mini); |
| 268 | + } |
| 269 | + } |
| 270 | + } |
| 271 | + |
| 272 | + // 纯文字: 没有主题色,只有文本蓝色和禁用2种情况。 |
| 273 | + &.@{button-prefix-cls}--text:not(.is-only-icon):not(.is-icon) { |
| 274 | + border: none; |
| 275 | + border-radius: 0; |
| 276 | + |
| 277 | + // 没有尺寸,没有padding |
| 278 | + padding: 0; |
| 279 | + min-width: unset; |
| 280 | + height: auto; |
| 281 | + font-size: var(--tv-Button-font-size-ontext); |
| 282 | + color: var(--tv-Button-text-color-ontext); |
| 283 | + background-color: transparent; |
| 284 | + |
| 285 | + &:hover { |
| 286 | + text-decoration: underline; |
| 287 | + } |
| 288 | + |
| 289 | + &.is-disabled.is-disabled.is-disabled.is-disabled, |
| 290 | + &.is-loading.is-loading.is-loading.is-loading, |
| 291 | + &[disabled][disabled][disabled][disabled][disabled][disabled] { |
| 292 | + color: var(--tv-Button-text-color-ontext-disabled); |
| 293 | + background-color: transparent; |
| 294 | + text-decoration: none; |
| 295 | + } |
| 296 | + } |
| 297 | + |
| 298 | + // 混排有边框: 图标大小随文字即可,只添加中间的margin |
| 299 | + &.is-icon { |
| 300 | + .tiny-svg { |
| 301 | + margin-right: var(--tv-Button-margin-right-isicon-svg); |
| 302 | + } |
| 303 | + } |
| 304 | + |
| 305 | + // 混排无边框: 设计稿的margin2.5不合适, 统一4px吧。 |
| 306 | + &.@{button-prefix-cls}--text.is-icon { |
| 307 | + border: none; |
| 308 | + border-radius: 0; |
| 309 | + padding: 0; |
| 310 | + min-width: unset; |
| 311 | + height: auto; |
| 312 | + font-size: var(--tv-Button-font-size-isicon-ontext); |
| 313 | + color: var(--tv-Button-text-color-isicon-ontext); |
| 314 | + background-color: transparent; |
| 315 | + |
| 316 | + &:hover { |
| 317 | + text-decoration: underline; |
| 318 | + } |
| 319 | + |
| 320 | + .tiny-svg { |
| 321 | + margin-right: var(--tv-Button-margin-right-isicon-svg); |
| 322 | + } |
| 323 | + |
| 324 | + &.is-disabled.is-disabled.is-disabled.is-disabled, |
| 325 | + &.is-loading.is-loading.is-loading.is-loading, |
| 326 | + &[disabled][disabled][disabled][disabled][disabled][disabled] { |
| 327 | + color: var(--tv-Button-text-color-ontext-disabled); |
| 328 | + background-color: transparent; |
| 329 | + text-decoration: none; |
| 330 | + } |
| 331 | + } |
| 332 | + |
| 333 | + // <img>+ 文字 |
| 334 | + & > img { |
| 335 | + margin-right: 4px; |
| 336 | + vertical-align: middle; |
| 337 | + } |
| 338 | + |
| 339 | + /** 5、其他场景 */ |
183 | 340 | & + & {
|
184 | 341 | margin-left: var(--tv-Button-margin-left-btn-to-btn-md);
|
185 | 342 | }
|
|
0 commit comments