Is it possible to include the style in the html?
Question
I'm currently using grapesjs to build email templates, however when I import HTML with the <style> tag already inside, before this is stored it split's the HTML and CSS up. When this is stored in my backend database, there is no <style> or <link> tag in the HTML, instead it's stored separately. Is there a way to prevent this and store a single compiled version of both, or at least is there a way to inject a style with the CSS before sending it to the server?
Answers (3)
Grapesjs doesn't support inlinecss, but you can use the same technique used here https://github.com/artf/grapesjs-preset-newsletter. It uses the juice package to merge the html and css
Yeah, at the moment the inline CSS is parsed for the CssComposer and removed from the DOM. This allows the editor to edit its styles.
One question about it.
How can ckeditor edit putting the span with inline styles and keep it after close and reopen the same template?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #843
[QUESTION] - CssComposer - removes unused classes
hi @artf , I import a html , using import from grapesjs-preset-newsletter, with some css classes inside the <style> tag. After the import,...
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...
Issue #632
Import HTML with file css
Could I use the tag link (example the bootstrap css link or my theme link) and style when I import HTML to grapejs?
Issue #2763
GrapesJs and PHP - store and load data to show in editor and as HTML page as well
I am using GrapesJS to build a simple webpage. I included the script in the following way inside head part : I am using GrapesJS to build a...
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.