美文网首页
微信小程序checkbox、radio样式修改

微信小程序checkbox、radio样式修改

作者: ZoranLee | 来源:发表于2020-07-03 17:42 被阅读0次

checkbox

/*checkbox 选项框大小  */
checkbox .wx-checkbox-input {
  width: 30px;
  height: 30px;
}
/*checkbox选中后样式  */
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  background: white;
}
/*checkbox选中后图标样式  */
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  font-size: 22px;
  color: red;
  background: transparent;
  transform: translate(-50%, -50%) scale(1);
  -webkit-transform: translate(-50%, -50%) scale(1);
}

radio

radio .wx-radio-input {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */
radio .wx-radio-input.wx-radio-input-checked {
  width: 30px; /* 选中后对勾大小,不要超过背景的尺寸 */
  height: 30px; /* 选中后对勾大小,不要超过背景的尺寸 */
  border: none;
  background: #f00;
}

/* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */
radio .wx-radio-input.wx-radio-input-checked::before {
  border-radius: 10px; /* 圆角 */
  width: 30px; /* 选中后对勾大小,不要超过背景的尺寸 */
  height: 30px; /* 选中后对勾大小,不要超过背景的尺寸 */
  line-height: 30px;
  text-align: center;
  font-size: 20px; /* 对勾大小 30px */
  color: red; /* 对勾颜色 白色 */
  border: 1px solid #cccccc;
  background: white;
  transform: translate(-50%, -50%) scale(1);
  -webkit-transform: translate(-50%, -50%) scale(1);
}

相关文章

网友评论

      本文标题:微信小程序checkbox、radio样式修改

      本文链接:https://www.haomeiwen.com/subject/xwlsqktx.html