Remove Duplicate Css Rule by Class
Question
Hi @artf , I'm reading and experimenting the setStyle method but when i used setStyle
editor.getSelectedToStyle().setStyle({ color: 'red' })
it duplicates the css rule of that class e.g
.class1{
color: 'black';
}
.class1{
color: 'red';
}
What I want is either removed the existing class
.class1{
color: 'black';
}
or update that existing class css rule
.class1{
color: 'black';
}
This issue is very similar to issue 932. I need avoidInlineStyle: to be set to false since im using inline style.
Please help. Thanks
Answers (2)
If there's no work around for this issue. what I need right now is used
cssComposer.getClassRule()
but the problem is, it is selecting the first class
.class1{
color: 'black';
}
and not this updated class
.class1{
color: 'red';
}
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 #1802
Unable to get ::after of class of selected
I can't get the css rule of a class with '::after' cssComposer.getClassRule("sample-class", {state: 'after'}) is there a way to get since t...
Issue #1608
[Question] Customize CSS class name
GrapesJs editor creates a unique class for element and adds CSS rules to it. For example, Now, is there any way to customize this behaviour...
Issue #546
Inline css to class
@artf thanks for amazing project, it mad site editing much easier. by default editor convert inline css to class but is there setting not t...
Issue #1844
Remove upload image option and disable (x) icon for default images
I want to remove the "Drop files here or click to upload" section and also disable the (x) cross icon next tothe default images, not allowi...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.