A way to add multiple CSS classes to MenuItem and CSS class to outside Prosemirror-menuitem #5

Open
opened 2017-02-07 21:34:12 +01:00 by jonsutherland · 0 comments
jonsutherland commented 2017-02-07 21:34:12 +01:00 (Migrated from github.com)

#Hello,

We're in the process of trying to style the prosemirror menu effectively, and we've encountered a couple small usability issues with menu 0.17.x

  1. We want to add multple classes to our MenuItem without having to do anything too drastic. I found that I couldn't easy do that with the current implementation of classes being added via classList.add. Array of strings or string with spaces would not work. I patched that by just appending to the element's className property.

  2. We want to be able to add a class property to the parent 'Prosemirror-menuitem' span also, for styling purposes. I couldn't find a way with the current implementation. My solution was to add a new spec property called 'menuItemClass' that I append to the parent span's class in renderGrouped.

I don't know if what I've done fits into your framework or not, but I've submitted my minor pull request with my basic changes #4

I'd appreciate if you could comment on how I can get around this or if prosemirror can accommodate my use cases.

Thanks

#Hello, We're in the process of trying to style the prosemirror menu effectively, and we've encountered a couple small usability issues with menu 0.17.x 1. We want to add multple classes to our MenuItem without having to do anything too drastic. I found that I couldn't easy do that with the current implementation of classes being added via classList.add. Array of strings or string with spaces would not work. I patched that by just appending to the element's className property. 2. We want to be able to add a class property to the parent 'Prosemirror-menuitem' span also, for styling purposes. I couldn't find a way with the current implementation. My solution was to add a new spec property called 'menuItemClass' that I append to the parent span's class in renderGrouped. I don't know if what I've done fits into your framework or not, but I've submitted my minor pull request with my basic changes #4 I'd appreciate if you could comment on how I can get around this or if prosemirror can accommodate my use cases. Thanks
Sign in to join this conversation.
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-menu#5
No description provided.