小程序 自定义多选框、单选框样式

/* 自定义 radio 样式 */
radio{
width: 38rpx;
}

radio .wx-radio-input{
border-radius: 50%;
width: 28rpx;
height: 28rpx;
}

/* 选中后的样式 (可根据设计稿需求自己修改) */
radio .wx-radio-input.wx-radio-input-checked::before{
border-radius: 50%;
width: 44rpx;
height: 44rpx; /
line-height: 44rpx;
text-align: center;
font-size: 26rpx; /* 对勾大小 26rpx */
color:#fff; /* 对勾颜色 */
background: #2facff;
border-color: #2facff;
}

/* 自定义 checkbox 样式 */
checkbox-group{
width: 50rpx;
}

/* 未选中的 背景样式 */
checkbox .wx-checkbox-input{
border-radius: 50%;/* 圆角 */
width: 40rpx; /* 背景的宽 */
height: 40rpx; /* 背景的高 */
}

/* 选中后的样式 (可根据设计稿需求自己修改) */
checkbox .wx-checkbox-input.wx-checkbox-input-checked{
background: #2facff;
border-color: #2facff;
}

checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{
border-radius: 50%;
width: 46rpx;
height: 46rpx;
line-height: 46rpx;
text-align: center;
font-size: 28rpx; /* 对勾大小 28rpx */
color: #fff; /* 对勾颜色 白色 */
background: transparent;
transform: translate(-50%, -50%) scale(1);
-webkit-transform: translate(-50%, -50%) scale(1);
}


原文:https://blog.csdn.net/Hug_rj/article/details/82017393

猜你喜欢

转载自www.cnblogs.com/wangshishuai/p/10785474.html