1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

Create a more beautiful checkbox

The browser's default checkbox is too ugly, especially in dark mode
This commit is contained in:
Cotes Chung
2020-12-14 00:24:33 +08:00
parent d0a8d072fd
commit d61446fafc
6 changed files with 65 additions and 10 deletions

View File

@@ -0,0 +1,12 @@
/*
* 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>");
});