Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 34 additions & 9 deletions packages/apps/app/src/renderer/src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Comment on lines +255 to 280
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Blanket !important makes future overrides brittle

Every property in the new .milkdown-editor.prose ul/ol block 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 !important or higher specificity. Consider applying !important only to the specific properties where Milkdown's own stylesheet is confirmed to win β€” rather than adding it blanket-wide.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/apps/app/src/renderer/src/assets/main.css
Line: 255-280

Comment:
**Blanket `!important` makes future overrides brittle**

Every property in the new `.milkdown-editor.prose ul/ol` block 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 `!important` or higher specificity. Consider applying `!important` only to the specific properties where Milkdown's own stylesheet is confirmed to win β€” rather than adding it blanket-wide.

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.prose li {
Expand Down Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Prompt To Fix With AI
This 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;
}

Expand Down
Loading