GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.05k forks source link

Style sections are duplicated #2838

Closed levansuper closed 4 years ago

levansuper commented 4 years ago

Hello Guys

I'm using: "grapesjs": "0.16.12", "grapesjs-preset-webpage": "0.1.11",

and in the css edit area i get this strange behavior:

Screen Shot 2020-06-19 at 00 39 13

a lot of the sections are duplicated!

this is the repository with my code: https://github.com/levansuper/grapes

artf commented 4 years ago

Hi Levan, please try to follow the template from the preset page https://github.com/artf/grapesjs/blob/gh-pages/demo.html

levansuper commented 4 years ago

@artf in my case the problem was that i was loading the module using node not directly in html. In the end I found and answer:

import gjsPresetWebpage from "grapesjs-preset-webpage";
bla, bla, bla...
GrapesJS.init({
...
plugins: [gjsPresetWebpage],
pluginsOpts: {
    [gjsPresetWebpage]: {
        customStyleManager: [{
            name: 'General2',
            open: false,
            buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
        }]
    }
})
etamity commented 3 years ago

@artf in my case the problem was that i was loading the module using node not directly in html. In the end I found and answer:

import gjsPresetWebpage from "grapesjs-preset-webpage";
bla, bla, bla...
GrapesJS.init({
...
plugins: [gjsPresetWebpage],
pluginsOpts: {
    [gjsPresetWebpage]: {
        customStyleManager: [{
            name: 'General2',
            open: false,
            buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
        }]
    }
})

I found out if you pass styleManager: { clearProperties: 1 } to GrapesJS also will resovle the problem