1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-06-08 00:27:58 +00:00
Cotes Chung d61446fafc Create a more beautiful checkbox
The browser's default checkbox is too ugly, especially in dark mode
2020-12-14 02:13:31 +08:00

13 lines
378 B
JavaScript

/*
* Create a more beautiful checkbox
*/
$(function() {
/* hide bullet of checkbox item */
$("li.task-list-item:has(input)").attr("hide-bullet", "");
/* create checked checkbox */
$("input[type=checkbox][checked=checked]").before("<span checked></span>");
/* create normal checkbox */
$("input[type=checkbox]:not([checked=checked])").before("<span></span>");
});