Can style manager always generate IDs instead of using already defined element's class ?
Question
When we style an element in the editor, if this element doesn't have neither a class or an id, the style manager generate a new id with the css style. However, styling an element with a class makes the style manager use this class to add styles.
Is there a way to always use IDs for styling and not work with classes ?
(this helps user make different custom styles on components that have same class attribute)
Answers (2)
window.editor = grapesjs.init({
// ...
selectorManager: {
componentFirst: 1,
}
// ...
});
Thanks a lot!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3053
Allowing user to add a global stylesheet to canvas dynamically
Hi, I wanted to provide the user the option to load a custom stylesheet to the canvas. This is so that the user can apply the custom define...
Issue #2378
[QUESTION] Modifying global CSS in style manager
We want to achieve the following:Mark our block HTML elements with some classes like:Add some styles that define CSS classes like:Using Gra...
Issue #913
[Question] Using Style tag instead of css
Hi, I've been taking a look inside of the dom_components, but cant seem to figure out how to manually override the styling aspect. I need a...
Issue #1877
[FEATURE REQUEST] Custom styles that add/remove custom classes?
Currently, all the style manager values that you change for an element simply update a <style> tag inline in the HTML. Is it possible to ch...
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.