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:
12
assets/js/_commons/checkbox.js
Normal file
12
assets/js/_commons/checkbox.js
Normal 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>");
|
||||
});
|
||||
Reference in New Issue
Block a user