Code manager set code
Hi @froderf, for now, the only way to get that rule is to use CssComposer.get method. In your case, .classx .c1234 is stored inside selectorsAdd as not being a single level class selector (eg. .class1.class2)
Read full answer below ↓Question
Hi @artf. Is there something similar to this editor.CodeManager.setCode(component, 'css', {cssc: editor.CssComposer} to update the css rule of the selected block returned from editor.CodeManager.getCode(component, 'css', {cssc: editor.CssComposer}); For example: This is the returned css rule collection from using editor.CodeManager.getCode(component, 'css', {cssc: editor.CssComposer}); Returned: What I need is to save and update it to like --------------------------------------- I tried the cc.setClassRule('c1234', { background: #222222 }); but this csscomposer function is limited for 1 class...
Answers (2)
Hi @froderf, for now, the only way to get that rule is to use CssComposer.get method. In your case, .classx .c1234 is stored inside selectorsAdd as not being a single level class selector (eg. .class1.class2)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #581
Reading component related events
The Editor API wiki lists a set of component-related events that can be listened to (e.g. component:add, component:update). There is howeve...
Issue #1638
how to stop css repeatition
hi @artf here is my code of Export-template i make it editable Also, i add a media-query to display in view code with this editor.setCompon...
Issue #454
Make block manager default open panel?
I tried this code: It works but doing this will hide the device selector in the top left for some reason.
Issue #513
Model and returned html issue
I have below code to create custom component and wants to retrieve updated html via editor.html() but return wrong html, I am sure I am mis...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.