[QUESTION] How to create custom block made of grapesjs components?
Question
Hi, i want to have custom blocks made of grapesjs components.
I found solution how to add components: https://github.com/artf/grapesjs/issues/1334#issuecomment-411519845 but i'm struggling with adding CSS (eaiher as string or as object).
Answers (3)
You should be able to do something like this:
...
components: [
{ tagName: 'h1', components: 'Some <b>content</b>', },
'<style>....</style>'
]
@artf thanks it works, but i found bug there.
When you drop this block on canvas it works ok, but if you delete this element from canvas or clear whole canvas, then drop this block on canvas 2nd time, it will lose css. 2nd time, 3rd time.. doesnt matter, If you removed element from canvas once, it will lose style for next drops.
@makkaronis4e for such a case, I'd ask you a reproducible demo, please
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1846
[Question]: Using ngModel on component that contains groups of tagName
I have tried this solution https://github.com/artf/grapesjs/issues/1819#event-2158016066 But on custom components Let's say, i have a mixtu...
Issue #3058
How to modify existing block properties in style manager
Version: 0.15.9 How to modify/remove few CSS properties for existing blocks like(text, image) in style manager I have checked the following...
Issue #1905
[QUESTION] Not editable block after import template
Have the same issue like in 1408. You said that JSON should be imported instead of the HTML. Can you tell me please how to import JSON temp...
Issue #2581
[Bug]: How to use components
Using GrapesJS 0.15.10 I cant get the components to work the way I intent. Its probable me, so if its a question, feel free to adjust the t...
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.