External CSS not loading in Canvas
Question
Using CSS in Init results in blank screen: I want to link multiple css files so that on the actual webpage I can define classes e.g.
Within Css file (example):
h6, .h6 {
font-size: 17px;
line-height: 24px;
}
And on webpage I would like to define text (e.g) to have class h6 or create a custom block where I can predefine classes. However, this doesn't work because the screen renders blank. My code:
const editor = grapesjs.init({
canvas:{
styles: [ 'https://...1.css', 'https://...2.css' ]
}
})
I am using the gjs-preset-webpage plugin --> not sure if this affects anything.
I hope that you can help because I have been trying to solve this over the past few days.
Kind Regards Aiyush
EDIT:
I read somewhere that bad CSS can break the editor. I am not sure what constitutes as bad CSS, is there a tool that I could run my CSS through to eliminate these issues here is one of my css sheets; it is rather large so I have attached it as a paste in: https://pastebin.com/ctje8bzY (please excuse the line numbers) UPDATE: here is a file without the line numbers: http://s000.tinyupload.com/index.php?file_id=24295452959919636560
Kind Regards Aiyush
Answers (1)
SOLVED: INCORRECT SYNTAX
Related Questions and Answers
Continue research with similar issue discussions.
Issue #811
[QUESTION] CSS Gets deleted
I have a website with multiple web pages (results-page, category page, home page) and a common css file for all pages (all.css).Within this...
Issue #966
[QUESTION] How to load external CSS file into Grapes Editor?
Hey, During my editor = grapesjs.init(), I want to load an external CSS file into the canvas using @import url(...). So when I use my custo...
Issue #4489
BUG: Loading initial project data from a designer-mode project results in wrong canvas size
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v103 Reproducible demo link https:/...
Issue #2796
CSS get removed when project init
Hi, I'm trying to import utility classes into grapes js. My issue is that grapes remove them if they are not use by an element in the canva...
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.