editor: fix item margins in editor (#7744)

This commit is contained in:
Ammar Ahmed
2025-03-06 15:45:50 +05:00
committed by Ammar Ahmed
parent 9c7ff38f99
commit a2a4a165a5
3 changed files with 11 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import { match, surround } from "fuzzyjs"; import { match, surround } from "fuzzyjs";
import { clone } from "./clone"; import { clone } from "./clone.js";
export function fuzzy<T>( export function fuzzy<T>(
query: string, query: string,

View File

@@ -75,9 +75,9 @@ export function TaskItemComponent(
opacity: [1, 1, 0], opacity: [1, 1, 0],
alignSelf: "start", alignSelf: "start",
bg: "transparent", bg: "transparent",
mt: isMobile ? "0.20ch" : "0.36ch", mt: isMobile ? "0.20ch" : 0,
cursor: "grab", cursor: "grab",
mx: 1, mr: 1,
fontFamily: "inherit" fontFamily: "inherit"
}} }}
size={isMobile ? "2.46ch" : "2.22ch"} size={isMobile ? "2.46ch" : "2.22ch"}
@@ -94,7 +94,7 @@ export function TaskItemComponent(
borderRadius: "default", borderRadius: "default",
alignSelf: "start", alignSelf: "start",
p: "1px", p: "1px",
mt: isMobile ? "0.20ch" : "0.36ch", mt: isMobile ? "0.20ch" : 0,
marginInlineEnd: 1, marginInlineEnd: 1,
cursor: editor.isEditable ? "pointer" : "unset", cursor: editor.isEditable ? "pointer" : "unset",
":hover": isMobile ":hover": isMobile

View File

@@ -111,7 +111,9 @@
filter: brightness(70%); filter: brightness(70%);
} }
.ProseMirror p[data-spacing="double"] { .ProseMirror > p[data-spacing="double"],
.ProseMirror div.callout > p[data-spacing="double"],
.ProseMirror blockquote > p[data-spacing="double"] {
margin-top: 1em; margin-top: 1em;
/* By default double spaced paragraphs have no bottom margin */ /* By default double spaced paragraphs have no bottom margin */
margin-bottom: 0px; margin-bottom: 0px;
@@ -119,7 +121,9 @@
/* Add top & bottom margin for double spaced paragraphs & adjacent nodes /* Add top & bottom margin for double spaced paragraphs & adjacent nodes
except single spaced paragraphs. */ except single spaced paragraphs. */
.ProseMirror p[data-spacing="double"] + *:not(p[data-spacing="single"]) { .ProseMirror > p[data-spacing="double"] + *:not(p[data-spacing="single"]),
.ProseMirror div.callout > p[data-spacing="double"] + *:not(div.callout > p[data-spacing="single"]),
.ProseMirror blockquote > p[data-spacing="double"] + *:not(.ProseMirror blockquote p[data-spacing="single"]) {
margin-top: 1em; margin-top: 1em;
margin-bottom: 1em; margin-bottom: 1em;
} }
@@ -550,7 +554,7 @@ p > *::selection {
.outline-list > li > :first-child::before { .outline-list > li > :first-child::before {
position: absolute; position: absolute;
top: 3px; top: 0px;
cursor: pointer; cursor: pointer;
content: ""; content: "";
background-size: 18px; background-size: 18px;