UNPKG

drip-ui

Version:

Lightweight Mobile UI Components built on Vue

123 lines (115 loc) 2.18 kB
@import './common/var.css'; .drip-switch { &--primary { color: $button-blue-color; background-color: #409eff; } &--orange { color: $button-orange-color; background-color: $button-orange-background-color; } &--green { color: $button-green-color; background-color: $button-green-background-color; } &__outer { display: inline-block; font-size: 14px; } &__bkg { min-width: 90px; width: 100%; margin: 0; position: relative; height: 45px; outline: none; border-radius: 23px; box-sizing: border-box; background: #dcdfe6; vertical-align: middle; display: flex; justify-content: space-around; line-height: 45px; } &--tip { cursor: pointer; width: 50%; min-width: 45px; color: #333; box-sizing: border-box; font-size: 14px; padding: 0 17px; border-radius: 23px; line-height: 45px; } &--button { cursor: pointer; box-sizing: border-box; width: 49%; position: absolute; left: 0; top: 0; border-radius: 23px; transition: all .3s; padding: 0 15px; height: 45px; font-size: 14px; line-height: 45px; text-align: center; } &--is-active { left: 50%; } } .is-disabled { opacity: 0.6; } .is-single{ .drip-switch { &__bkg { background: none; background: #dcdfe6; } &--tip { border-radius: 20px; font-size: 24px; box-sizing: border-box; height: 100%; color: #FFFFFF; width: 100%; height: 45px; padding-left: 20px; padding-right: 50px; &:nth-child(2) { display: none; } } &--button { width: 41px; left: calc(100% - 41px);; top: 1px; bottom: 0; right: 0; border-radius: 20px; padding: 0 17px; height: 41px; background: #FFFFFF; &.is-active { left: 2px; } } } .is-check{ .drip-switch--tip{ width: 100%; &:nth-child(1) { display: none; } &:nth-child(2) { display: block; padding-left: 50px; padding-right: 20px; } } } }