Compare commits
2 Commits
60be198e51
...
2f5d94504d
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f5d94504d | |||
| 40b9593b47 |
@ -1623,15 +1623,12 @@ ul[data-type='task_list'] li {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The checkbox is the top flex child; nudge it onto the first text line and
|
/* The checkbox is the top flex child; nudge it onto the first text line and
|
||||||
drop the leading/trailing margins of the item's paragraphs so the text meets
|
drop the leading/trailing margins of the item's paragraph so the text meets
|
||||||
the checkbox instead of dropping a line. DESCENDANT selectors on purpose
|
the checkbox instead of dropping a line. Covers both DOM shapes: read-mode
|
||||||
(issue #137, second regression): the DOM depth differs per surface —
|
`li > input` + `li > p`, and editor `li > label > input` + `li > div > p`.
|
||||||
public/docToHtml renders `li > input` + `li > p`, but the editor/auth read
|
Uses `:first-of-type`/`:last-of-type` (NOT `:first-child`): in the read-mode
|
||||||
view (TipTap ReactNodeView) nests the paragraph TWO wrappers deep:
|
markup the `<input>` is the first child, so the paragraph is never
|
||||||
`li > div[data-node-view-content] > div > p`. Child-combinator chains keep
|
`:first-child` and a `:first-child` reset would silently miss (issue #137). */
|
||||||
missing one of the shapes; matching any `p` inside the task item is the
|
|
||||||
robust form. `:first-of-type`/`:last-of-type` (NOT `:first-child`) because
|
|
||||||
the `<input>`/`<label>` precedes the paragraph in the read-mode markup. */
|
|
||||||
ul[data-type='task_list'] li > input[type='checkbox'],
|
ul[data-type='task_list'] li > input[type='checkbox'],
|
||||||
ul[data-type='task_list'] li > label {
|
ul[data-type='task_list'] li > label {
|
||||||
flex: none;
|
flex: none;
|
||||||
@ -1645,11 +1642,13 @@ ul[data-type='task_list'] li > label {
|
|||||||
margin-top: calc(0.25em - 3px);
|
margin-top: calc(0.25em - 3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
ul[data-type='task_list'] li p:first-of-type {
|
ul[data-type='task_list'] li > p:first-of-type,
|
||||||
|
ul[data-type='task_list'] li > div > p:first-of-type {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul[data-type='task_list'] li p:last-of-type {
|
ul[data-type='task_list'] li > p:last-of-type,
|
||||||
|
ul[data-type='task_list'] li > div > p:last-of-type {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user