In React How to give local css path for grapesjs editor ?
As I am working in Reactjs with grapesjs, I want to load html template in to grapesjs.I am having separate css folder in my local react application ? How to load that css when grapesks editor initializing
grapesjs.init({
canvas: {
styles: ["style.css"]
},
...
})
grapesjs.init({ canvas: { styles: ["style.css"] }, ... })
where to store that css file ? i mean path to keep that file in react
Depends how you're bundling and serving your pages. For example, if you're serving a build folder, with the CSS in a subfolder there, then use '/css/style.css'.
im working with vue and grapes s i want lo load a loacal html file and display inside the editor, i'm new to grapesjs please tell me is there any way of loading a local html file into grapes js Thanks in advance . mycode
mounted() { const LandingPage = { html: '../userpage/index.html', css: ['../userpage/style.css','../userpage/css.css','../userpage/bootstrap.min.css'], components: null, style: null, }; this.editor = grapesjs.init({ container: "#gjs", canvas: { styles: ["../userpage/style.css"], html:"../userpage/index.html" }, fromElement: true, components: LandingPage.components || LandingPage.html, style: LandingPage.style || LandingPage.css, plugins: [], pluginsOpts: { "gjs-preset-webpage": {} }, storageManager: { type: 'local', stepsBeforeSave: 10, urlStore: '', urlLoad: '', params: {}, headers: {}, }, }); }