So I’ve been experimenting to ways of formatting text when a checkbox is checked inside of a table, and so far I have a css way of doing it (that I would like to not use, but I’ll explain why further down) but wanted to know if there would be a tiddlywiki way of doing it, since the example below, doesn’t work out of the box for firefox…
<style>
td:has( input[type="checkbox"]:checked ) ~ td.bye {
text-decoration: line-through red;
color: grey;
}
</style>
<table>
<tr>
<td class="hello"><input type="checkbox"/></td>
<td class="bye">text to style </td>
</tr>
</table>
I was thinking the $reveal widget would be able to, but I haven’t had any luck so far. I’m sure I’m overlooking something, but figured I would share this and see if anybody has a better method in mind, since the :has selector is so new to CSS
I’ve been using the input tag just for testing, but I already know the same is possible with the checkbox widget.
Edit:
For anyone looking for something like this but not in a table, you can use this (below) from an older google groups tiddlywiki thread!
<style>
.tc-checkbox input:checked + span {
color: gray;
text-decoration: line-through red;
}
input[type="checkbox"] { margin-right: 4px !important;}
</style>
<$checkbox>Hello</$checkbox>