tiptap icon indicating copy to clipboard operation
tiptap copied to clipboard

Please add a setStyle/setClass command for selected node

Open Arturexe opened this issue 2 years ago • 1 comments

What problem are you facing?

I need to add styles to an image.

What’s the solution you would like to see?

editor.commands.setStyle('ProseMirror-selectednode', { 'margin-inline': 'auto 0' })

This style would align the node/image to the right in a very convenient way. Same thing could be done for float or width. It's kind of a loss, that tiptap doesn't provide a more convenient approach to utilize the power of CSS. It already has a clean html structure.

What alternatives did you consider?

Fiddling around with custom extensions and custom vue components, all off which could be prevented by this command.

Anything to add? (optional)

I love TipTap.

Are you sponsoring us?

  • [ ] Yes, I’m a sponsor. 💖

Arturexe avatar Jun 10 '22 23:06 Arturexe

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Aug 01 '22 17:08 github-actions[bot]

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Oct 31 '22 00:10 github-actions[bot]

I have the same issue, it would be good to either describe how to achieve the above request or implement some extra methods.

It is also very appreciated if you could put some love in your official documentation 'cause it's really dreadful to understand what to expect from each exposed method.

dvago avatar Aug 02 '23 14:08 dvago

Same problem. I've seen that image extension has a ProseMirror selection style, but I still can't implement it to my custom nodes +1

Haze272 avatar Nov 14 '23 09:11 Haze272