Copy/paste styles between components #4539
havrylenko-olena
started this conversation in
Ideas
Replies: 3 comments 2 replies
-
I may have missunderstood but isn't css classes what you are looking for? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I'm not sure about adding something new to the core UI but you should be able to implement that functionality relatively simply by using the StyleManager API. // Using for convenience a simple variable to keep track of copied styles
let copiedStyles = {};
const { StyleManager, Commands } = editor;
Commands.add('copy-styles', () => {
copiedStyles = StyleManager.getSelected()?.getStyle() || {};
});
Commands.add('paste-styles', () => {
StyleManager.getSelected()?.addStyle(copiedStyles);
}); Using the Commands API is not mandatory, but that might help to make this functionality more reusable if you decide to place it in a plugin (eg. to use commands |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be nice to have ability to copy/paste styles between grapesjs components.
Maybe like some additional buttons on Styles panel.
Beta Was this translation helpful? Give feedback.
All reactions