-
Notifications
You must be signed in to change notification settings - Fork 22
fix(editor): align text indentation across bullet, ordered, and task lists #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -249,7 +249,34 @@ | |
|
|
||
| .ProseMirror.prose ul, | ||
| .ProseMirror.prose ol { | ||
| padding-left: 1.25em; | ||
| padding-left: 2.25em; | ||
| } | ||
|
|
||
| .milkdown-editor.prose ul { | ||
| padding-left: 2.25em !important; | ||
| padding-inline-start: 2.25em !important; | ||
| } | ||
|
|
||
| .milkdown-editor.prose ol { | ||
| list-style: none !important; | ||
| counter-reset: ol-counter !important; | ||
| padding-left: 2.25em !important; | ||
| padding-inline-start: 2.25em !important; | ||
| } | ||
|
|
||
| .milkdown-editor.prose ol > li { | ||
| counter-increment: ol-counter !important; | ||
| position: relative !important; | ||
| } | ||
|
|
||
| .milkdown-editor.prose ol > li::before { | ||
| content: counter(ol-counter) "." !important; | ||
| position: absolute !important; | ||
| left: -2em !important; | ||
| width: 1.75em !important; | ||
| text-align: right !important; | ||
| white-space: nowrap !important; | ||
| font-variant-numeric: tabular-nums !important; | ||
| } | ||
|
|
||
| .ProseMirror.prose li { | ||
|
|
@@ -314,30 +341,28 @@ | |
|
|
||
| /* Task list checkbox styling (Milkdown GFM) */ | ||
| .ProseMirror ul:has(> li[data-item-type="task"]) { | ||
| padding-inline-start: 0; | ||
| padding-left: 0; | ||
| padding-inline-start: 2.25em !important; | ||
| padding-left: 2.25em !important; | ||
| } | ||
|
|
||
| .ProseMirror li[data-item-type="task"] { | ||
| display: flex; | ||
| align-items: flex-start; | ||
| gap: 0.5rem; | ||
| position: relative; | ||
| list-style: none; | ||
| margin-top: 0; | ||
| margin-bottom: 0; | ||
| } | ||
|
|
||
| .ProseMirror li[data-item-type="task"] > input[type="checkbox"] { | ||
| flex-shrink: 0; | ||
| position: absolute; | ||
| left: -1.75em; | ||
| top: 0.25em; | ||
| cursor: pointer; | ||
| margin-top: 0.3em; | ||
| accent-color: var(--color-primary); | ||
| } | ||
|
Comment on lines
355
to
361
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The ordered-list Prompt To Fix With AIThis is a comment left during a code review.
Path: packages/apps/app/src/renderer/src/assets/main.css
Line: 355-361
Comment:
**Checkbox right-edge may not align with counter right-edge**
The ordered-list `::before` counter sits at `left: -2em` with `width: 1.75em`, placing its right edge at `β0.25em` from the text content. The task-list checkbox is anchored at `left: -1.75em`, so its right edge lands at roughly `β0.75em` depending on the browser's native checkbox width (~1em). If pixel-perfect alignment of all three gutter markers matters, the checkbox offset may need a small tweak (e.g. `left: -2em`) to align its right edge with the counter's.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
|
|
||
| .ProseMirror li[data-item-type="task"] > span, | ||
| .ProseMirror li[data-item-type="task"] > div, | ||
| .ProseMirror li[data-item-type="task"] > p { | ||
| flex: 1; | ||
| line-height: 1.25; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!importantmakes future overrides brittleEvery property in the new
.milkdown-editor.prose ul/olblock is flagged!important. If a parent component or a theme variant ever needs to adjust indentation or counter behaviour (e.g. a compact/read-only view), it must fight these with its own!importantor higher specificity. Consider applying!importantonly to the specific properties where Milkdown's own stylesheet is confirmed to win β rather than adding it blanket-wide.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!