fix: nested ordered-list style (#1351)

* feat: dynamic ordered-list style
* fix nested task list import
This commit is contained in:
Philip Okugbe
2025-07-15 02:43:59 +01:00
committed by GitHub
parent 16ec218ba7
commit 9f39987404
3 changed files with 38 additions and 1 deletions

View File

@ -11,3 +11,4 @@
@import "./print.css"; @import "./print.css";
@import "./find.css"; @import "./find.css";
@import "./mention.css"; @import "./mention.css";
@import "./ordered-list.css";

View File

@ -0,0 +1,34 @@
/* Ordered list type cycling based on nesting depth */
ol,
ol ol ol ol,
ol ol ol ol ol ol ol,
ol ol ol ol ol ol ol ol ol ol {
list-style-type: decimal;
}
ol ol,
ol ol ol ol ol,
ol ol ol ol ol ol ol ol,
ol ol ol ol ol ol ol ol ol ol ol {
list-style-type: lower-alpha;
}
ol ol ol,
ol ol ol ol ol ol,
ol ol ol ol ol ol ol ol ol,
ol ol ol ol ol ol ol ol ol ol ol ol {
list-style-type: lower-roman;
}
ol {
list-style-position: outside;
margin-left: 0.25rem;
}
/* Nested list spacing */
ol ol,
ol ul,
ul ol {
margin-top: 0.1rem;
margin-bottom: 0.1rem;
}

View File

@ -48,7 +48,9 @@ export const tiptapExtensions = [
Comment, Comment,
TextAlign.configure({ types: ["heading", "paragraph"] }), TextAlign.configure({ types: ["heading", "paragraph"] }),
TaskList, TaskList,
TaskItem, TaskItem.configure({
nested: true,
}),
Underline, Underline,
LinkExtension, LinkExtension,
Superscript, Superscript,