Grapesjs: [QUESTION] After installing grapesjs-style-bg plugin, how do I add it to StyleManager?

Created on 26 Jun 2020  路  2Comments  路  Source: artf/grapesjs

Newbie question here, I added the plugin grapesjs-style-bg to the stack, now how to I show it in my StyleManager?

I reset all the sectors from the StyleManager on initialization, and then I add them one by one using styleManager.addSector("id", {...}).

Most helpful comment

@pooriamo, thanks man! Life saver! It works great! :)))

Thanks for the cheatssheet too, lots of goodies in there!

All 2 comments

You can cheat from here: https://github.com/artf/grapesjs/blob/gh-pages/demo.html#L1127

You must add background-bg to the buildProps array and then config it in properties, the type must be bg:

[
    ...
    {
        name: 'Decorations',
        open: false,
        buildProps: ['opacity', 'border-radius', 'border', 'box-shadow', 'background-bg'],
        properties: [
            ...
            {
                id: 'background-bg',
                property: 'background',
                type: 'bg',
            }
        ]
        ...
    }
]

@pooriamo, thanks man! Life saver! It works great! :)))

Thanks for the cheatssheet too, lots of goodies in there!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kickbk picture kickbk  路  3Comments

ryandeba picture ryandeba  路  3Comments

kawika-connell picture kawika-connell  路  3Comments

andre2 picture andre2  路  3Comments

adam-gpc picture adam-gpc  路  3Comments