Add custom style in the style-sheet for a new class of existing block.
Question
Hello @artf
_("map") && i.add("map", {
label: n.labelMap,
category: n.category,
attributes: {
class: "fa fa-map-o"
},
content: {
type: "map",
classes:['map-width'],
// unstylable:['width'],
style: {
// height: "350px",
// width: "auto",
}
}
});
add a new class 'map-width' on map element, now I want to add new css for that class.
can you please guide me how to add custom style in the style-sheet for that class. so it'll display in the css section when click on export. and also reflect in pink with x sign like it's added externally.
please guide me
Thanks in advance. :)Answers (2)
You can add it in template or inside blocks. BTW check other issues before opening a new one, there are plenty of questions like this
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 #1471
[Question] Blockmanager and Image
Hi! I use this code to add a new block: blockManager.add("image", { label: 'Image', category: 'Basic', attributes: { class: "gjs-fonts gjs-...
Issue #1556
Add new block to block manager: predefined content and editor content is different
I try to use template engine with grapesjs. Add new block by this: Drag new block to editor then the content of editor is different from ab...
Issue #1817
Change HTML content while block is render in editor
Hello @artf I have one block into block manager like As per above script inside the block, i want to add dynamic HTML content while this bl...
Issue #1572
Issue when adding video block manually
I added Video Block manually like this. <pre> blockManager.add('video', { label: 'Video', category: 'Media', attributes: {class: 'fa fa-you...
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.