Skip to content
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

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

Open
jonsutherland opened this issue Feb 7, 2017 · 0 comments

Comments

@jonsutherland
Copy link

jonsutherland commented Feb 7, 2017

#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

@jonsutherland jonsutherland changed the title MenuItem a way to add multiple classes to MenuItem and class to outside Prosemirror-menuitem A way to add multiple CSS classes to MenuItem and CSS class to outside Prosemirror-menuitem Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant