@button-default-height: 86rpx; @button-border-radius: 18rpx; @button-default-font-size: 32rpx; @button-default-color: #fff; wx-button:not([size=mini]) { margin-left: auto; margin-right: auto; width: auto; } .toy-button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; height: @button-default-height; border-radius: @button-border-radius; font-size: @button-default-font-size; color: @button-default-color; padding: 0 44rpx; font-weight: normal; // width: auto !important; // transition: all 0.04s; &--primary { background: rgba(255, 215, 25, 1); box-shadow: 0px 10rpx 2rpx #DBB917; &.disabled { background: rgba(255, 215, 25, 0.5); box-shadow: 0px 10rpx 2rpx rgba(219, 185, 23, 0.5); } &.active { transform: translateY(10rpx); box-shadow: 0 0 0 rgba(219, 185, 23, 0.5); /* 阴影效果 */ } } &--green { background: #93d333; box-shadow: 0px 10rpx 2rpx rgba(121, 185, 21, 1); &.disabled { background: rgba(147, 211, 51, 0.5); box-shadow: 0px 10rpx 2rpx rgba(121, 185, 21, 0.5); } &.active { transform: translateY(10rpx); box-shadow: 0 0 0 rgba(121, 185, 21, 0.5); /* 阴影效果 */ } } &--white { color: rgba(34, 36, 37, 0.9); background: #fff; box-shadow: 0 8rpx 0rpx rgba(223, 220, 220, 1); border: 2rpx solid rgba(223, 220, 220, 1); &.disabled { color: rgba(34, 36, 37, 0.5); background: rgba(255, 255, 255, 0.7); box-shadow: 0px 8rpx 0rpx rgba(223, 220, 220, 0.9); } &.plain { color: #fff; background: rgba(255, 255, 255, 0.2); border: 2rpx solid rgba(255, 255, 255, 1); box-shadow: 0px 8rpx 0rpx rgba(255, 255, 255, 0.88); // &.disabled { // background: rgba(255, 255, 255, 0.2); // border: 1px solid rgba(255, 255, 255, 0.6); // box-shadow: 0px 3px 0px rgba(255, 255, 255, 0.6); // } } &.active { transform: translateY(8rpx); box-shadow: 0 0 0 rgba(223, 220, 220, 1); /* 阴影效果 */ } } &--flat { box-shadow: none !important; border: none; transition: background 0.1s; // 覆盖所有颜色变体 &.toy-button--primary, &.toy-button--green, &.toy-button--white { box-shadow: none !important; border: none !important; &.active { transform: none !important; box-shadow: none !important; } } // 特殊处理白色plain模式 &.toy-button--white.plain { background: transparent !important; border: none !important; box-shadow: none !important; } // 重置active变换 &.active { transform: none !important; } // 彩色按钮active背景变化 &.toy-button--primary.active { background: rgba(255, 215, 25, 0.7); } &.toy-button--green.active { background: rgba(147, 211, 51, 0.7); } &.toy-button--white.active { background: rgba(255, 255, 255, 0.7); } } .loading-class, &__icon { margin-right: 18rpx; } }