Skip to content

Commit 6cfaae7

Browse files
committed
🐛 checkboxes in live preview
1 parent 84c4256 commit 6cfaae7

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/templates/CHECKBOXES.eta

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,20 @@ function defineColors(i, ts) {
6969
function customTask(i, ts) {
7070
%>
7171
div[data-task="<%~ ts.data %>"],
72-
li[data-task="<%~ ts.data %>"] {
72+
li[data-task="<%~ ts.data %>"],
73+
li[data-task="<%~ ts.data %>"] > p {
74+
color: var(--<%~ root %>-li-<%= i %>);
75+
background-color: var(--<%~ root %>-li-bg-<%= i %>);
76+
text-decoration: <%~ getTextDecoration(ts.li.format) %>;
77+
font-weight: <%~ getFontWeight(ts.li.format) %>;
78+
font-style: <%~ getFontStyle(ts.li.format) %>;
79+
font-size: <%~ getFontSize(ts.li.format) %>px;
80+
font-family: <%~ getFont(ts.li.format, "inherit") %>;
81+
}
82+
div[data-task="<%~ ts.data %>"] > label.task-list-label,
83+
li[data-task="<%~ ts.data %>"],
84+
li[data-task="<%~ ts.data %>"] > p,
85+
.markdown-source-view.mod-cm6 .HyperMD-task-line[data-task="<%~ ts.data %>"] {
7386
--checkbox-color: var(--<%~ root %>-checkbox-<%= i %>);
7487
--checkbox-marker-color: transparent;
7588
--checklist-done-decoration: <% tR += getTextDecoration(ts.checkbox.format) %>;
@@ -79,14 +92,10 @@ li[data-task="<%~ ts.data %>"] {
7992
<% if (!ts.checkbox.hideBorder) { %>
8093
--checkbox-border-color: var(--<%~ root %>-checkbox-<%= i %>);
8194
<% } %>
82-
color: var(--<%~ root %>-li-<%= i %>);
83-
background-color: var(--<%~ root %>-li-bg-<%= i %>);
8495
}
85-
div[data-task="<%~ ts.data %>"] > input[type=checkbox]:checked,
86-
div[data-task="<%~ ts.data %>"] > p > input[type=checkbox]:checked,
96+
input[type=checkbox][data-task="<%~ ts.data %>"]:checked,
8797
li[data-task="<%~ ts.data %>"] > input[type=checkbox]:checked,
8898
li[data-task="<%~ ts.data %>"] > p > input[type=checkbox]:checked {
89-
color: var(--checkbox-color);
9099
background: var(--<%~ root %>-checkbox-bg-<%= i %>);
91100
<% if (ts.checkbox.preventClick) { %>
92101
pointer-events: none;
@@ -96,8 +105,7 @@ li[data-task="<%~ ts.data %>"] > p > input[type=checkbox]:checked {
96105
border: 0px;
97106
<% } %>
98107
}
99-
div[data-task="<%~ ts.data %>"] > input[type=checkbox]:checked:after,
100-
div[data-task="<%~ ts.data %>"] > p > input[type=checkbox]:checked:after,
108+
input[type=checkbox][data-task="<%~ ts.data %>"]:checked:after,
101109
li[data-task="<%~ ts.data %>"] > input[type=checkbox]:checked:after,
102110
li[data-task="<%~ ts.data %>"] > p > input[type=checkbox]:checked:after {
103111
transform: none;

0 commit comments

Comments
 (0)