Skip to content

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

@jonsutherland

Description

@jonsutherland

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions