Điều này phụ thuộc vào loại hộp kiểm bạn sử dụng - điền-in lớp hay không. Bạn sẽ phải đặt trong từ khóa màu CSS như needbe ... chỉ cần thay thế 'indigo' của tôi cho bất kỳ màu nào bạn yêu cầu.
*** Lưu ý - Các lớp Ligthen và Darken sẽ không hoạt động với điều này.
.checkbox-indigo[type="checkbox"] + label:before{
border: 2px solid indigo;
background: transparent;
}
.checkbox-indigo[type="checkbox"]:checked + label:before{
border: 2px solid transparent;
border-bottom: 2px solid indigo;
border-right: 2px solid indigo;
background: transparent;
}
.checkbox-indigo.filled-in[type="checkbox"] + label:after{
border: 2px solid indigo;
background: transparent;
}
.checkbox-indigo.filled-in[type="checkbox"]:checked + label:after{
background: indigo;
}
.checkbox-indigo.filled-in[type="checkbox"]:checked + label:before{
border-top: 2px solid transparent;
border-left: 2px solid transparent;
border-right: 2px solid #fff;
border-bottom: 2px solid #fff;
}
http://embed.plnkr.co/zWaJVtsAVXxs0fVLmxRH/
Nguồn
2016-10-02 05:21:09
Tuyệt vời! Cảm ơn bạn! – arnuga3
Tôi vừa thử điều này và nó không hoạt động. Bất kỳ ý tưởng nếu nó thay đổi? –
@ Stupid.Fat.Cat biến nó thành 'label: before' thay vì' after' pseudo el – mg87