switchBlock.sass 1.01 KB
/* components/switchBlock/switchBlock.wxss */
.switch-box {
  box-sizing: border-box;
  padding: 4rpx;
  width: 172rpx;
  height: 56rpx;
  border-radius: 8rpx;
  display: flex;
  background: #f7f8fa;
  // border: var(--fontSize2) solid #347BFF;
  font-size: var(--fontSize28);
  color: #999EA8;
  margin-left: auto;
  position: relative;
}

.text-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.switch-box .block {
  position: absolute;
  top: 4rpx;
  left: 4rpx;
  width: 80rpx;
  border-radius: 4rpx;
  height: 48rpx;
  background: #fff;
  transition: all .25s;
}

.switch-box .block.right {
  left: 50%;
}

.switch-box .male,
.switch-box .woman {
  width: 80rpx;
  height: 48rpx;
  position: absolute;
  top: 4rpx;
  transition: all .25s;
  color: #999EA8;
}

.switch-box .male {
  left: 4rpx;
}

.switch-box .woman {
  right: 4rpx;
}

.switch-box .male.active,
.switch-box .woman.active {
  color: #292d33;
}

.disabled {
  opacity: .5;
}