Set default cursor color to currentColor #22

Closed
ocavue wants to merge 1 commit from ocavue/color into master
ocavue commented 2025-03-26 01:10:46 +01:00 (Migrated from github.com)

Change the default cursor color from black to currentColor. This makes the lib support dark mode by default, since currentColor is black in the light mode, and is white in the dark mode.

Before:

https://github.com/user-attachments/assets/ff8d7433-4e4a-425d-968e-f2a8550bfbc8

After:

https://github.com/user-attachments/assets/5c82edcf-2a4f-4bab-a9ea-fc6b5cdb8322

Change the default cursor color from `black` to `currentColor`. This makes the lib support dark mode by default, since `currentColor` is `black` in the light mode, and is `white` in the dark mode. Before: https://github.com/user-attachments/assets/ff8d7433-4e4a-425d-968e-f2a8550bfbc8 After: https://github.com/user-attachments/assets/5c82edcf-2a4f-4bab-a9ea-fc6b5cdb8322
marijnh commented 2025-03-26 07:27:35 +01:00 (Migrated from github.com)

It might have been a good idea to do it this way in the initial implementation, but at this point I think changing this would be too disruptive. The element is added to the editor's offsetParent, which may have a completely different color style than the editor itself. Since you can configure the color to be currentColor via the extension's color option, I recommend you do that to address this issue in your setup.

It might have been a good idea to do it this way in the initial implementation, but at this point I think changing this would be too disruptive. The element is added to the editor's `offsetParent`, which may have a completely different `color` style than the editor itself. Since you can configure the color to be `currentColor` via the extension's `color` option, I recommend you do that to address this issue in your setup.
ocavue commented 2025-03-26 10:41:25 +01:00 (Migrated from github.com)

Thank you for pointing that out. Your reason makes a lot of sense.

Thank you for pointing that out. Your reason makes a lot of sense.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-dropcursor!22
No description provided.