File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -166,6 +166,32 @@ input[type='checkbox']:checked {
166166 opacity : 1 ;
167167}
168168
169+ /*
170+ * Task list items rendered from markdown (e.g. `- [x] done`) produce
171+ * `<li class="task-list-item"><input type="checkbox" checked disabled> ...</li>`
172+ * without a `.checkbox-wrapper`, so the wrapper-based checkmark above does
173+ * not apply. Pseudo-elements cannot be placed on `<input>` elements, so we
174+ * draw the checkmark on the parent `<li>` using `:has()`, positioned over
175+ * the checkbox.
176+ */
177+ .task-list-item {
178+ position : relative;
179+ }
180+
181+ .task-list-item : has (> input [type = 'checkbox' ]: checked)::before ,
182+ .task-list-item : has (> p > input [type = 'checkbox' ]: checked )::before {
183+ content : '' ;
184+ position : absolute;
185+ top : 5px ;
186+ left : 6px ;
187+ width : 5px ;
188+ height : 10px ;
189+ border : solid var (--vscode-checkbox-foreground );
190+ border-width : 0 1px 1px 0 ;
191+ transform : rotate (45deg );
192+ pointer-events : none;
193+ }
194+
169195input [type = 'checkbox' ]: focus {
170196 outline : 1px solid var (--vscode-focusBorder );
171197 outline-offset : 1px ;
You can’t perform that action at this time.
0 commit comments