Previously saved css rules not showing in Style Manager
Question
Previously saved css rules using remote method are not showing in Style Manager.
remote json response
{"gjs-assets":"","gjs-css":"*{box-sizing: border-box;}body{margin:0;}#c743{background-color:#b0aeae;}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#c743{background-color:rgb(76, 70, 70);}body{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}#c743{background-color:rgb(234, 38, 10);}#c838{background-color:rgb(83, 19, 215);}.row{display:table;padding-top:10px;padding-right:10px;padding-bottom:10px;padding-left:10px;width:100%;}.cell{width:8%;display:table-cell;height:75px;}@media (max-width: 768px){.cell{width:100%;display:block;}}","gjs-styles":"","gjs-html":"<div class=\"row\"><div class=\"cell\" id=\"c743\"><\/div><\/div><div class=\"row\"><div class=\"cell\" id=\"c838\"><\/div><\/div>","gjs-components":""}
At the same time this css rules are applied correctly to the content of editor.
When new styles are applied to overwrite the existing css using Style Manager, the newly created css rules are not replacing corresponding existing css rule.
editor.getCss() returns both old and new css rules.
Answers (3)
Post the grapesjs config and its version
var editor = grapesjs.init({
container : '#gjs',
plugins: ['gjs-blocks-basic'],
// protectedCss: '',
storageManager: {
type: 'remote',
stepsBeforeSave: 10,
autoload: true,
urlLoad: base_url+'superadmin/educationalContent/get_learn_page/'+<?php echo $concept_id; ?>,
contentTypeJson:true,
params: {}, // For custom values on requests
},
assetManager: {
assets:
<?php echo $new_images; ?>
/* 'http://placehold.it/350x250/78c5d6/fff/image1.jpg',
// Pass an object with your properties
{
type: 'image',
src: 'http://placehold.it/350x250/459ba8/fff/image2.jpg',
height: 350,
width: 250
},
{
// As the 'image' is the base type of assets, omitting it will
// be set as `image` by default
src: 'http://placehold.it/350x250/79c267/fff/image3.jpg',
height: 350,
width: 250
},*/
,
noAssets: 'No assets',
upload: base_url+'superadmin/qsm/upload/uploadGrapes',
uploadName:'file',
autoAdd: 1,
dropzone: 1,
},
});
Version : 0.12.17
To try with the latest version
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1333
Bug in WebPage Demo
To reproduce: 1) Open https://grapesjs.com/demo.html in incognito mode. 2) Import this code: 3) Clear Canvas 4) Press Import. Result: The c...
Issue #1083
import template
Hi . I have a json string like this '{ "assets": "[{\"type\":\"image\",\"src\":\"./img/team1.jpg\",\"unitDim\":\"px\",\"height\":0,\"width\...
Issue #1354
Change css editor behavior
In the "Export" codemirror modal, I would like to change the default behavior of the CSS part. Currently it removes the "<style>" opening a...
Issue #1631
how to display Css in Code viewer in newsletter plugin?
Hi @artf i want to display my css in replace of protectedCss: '* { box-sizing: border-box; } body {margin: 0;}', how can i achieve in newsl...
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.