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.37k stars 4.05k forks source link

[BUG] Gradient plugin is interfering with background-image #2138

Closed alikabeer32 closed 1 year ago

alikabeer32 commented 5 years ago

The background-image url is getting wrapper around by linear-gradient() function like so

background-image: -webkit-linear-gradient(path/to/image.jpg);

Even though I assigned gradient to 'background' property instead of 'background-image'

          editor.StyleManager.addProperty('decorations', {
          name: 'Gradient',
          property: 'background',
          type: 'gradient',
          defaults: 'none'
        });

I can't reproduce the bug in the demo of either grapesjs or the plugin because in neither of them have the two features (background image and gradient ) been used together.

alikabeer32 commented 5 years ago

UPDATE: I know it's a very hacky fix but what I did is replace every 'backgroundImage' with just 'background' in the grapesjs-style-gradient.min.js file of the plugin. And now it works like I need it to. Perhaps someone could provide a better solution?

robsonsobral commented 4 years ago

Wow! I'm not the only one going crazy!

background-image: -webkit-linear-gradient(https://domain.com/webasset.jpg?auth=eyJhbGciOiJSUzIN9wiUo3kUgN1BIFlHwaI9A)

@artf , do you have any suggestion? Where should a pull request be submited?

tomaskallup commented 4 years ago

Also seeing this bug, however I'm not even using gradient plugin and it's only happening with some images :thinking:

robsonsobral commented 4 years ago

I even tried to replace the background plugin with no luck.

tomaskallup commented 4 years ago

Here is an example image that seems to fail every time for me. waves-2

artf commented 4 years ago

Does anyone is able to create a reproducible demo, please?

robsonsobral commented 4 years ago

I'm sorry, guys. I can't find time to work on this project again until next week, I guess.

artf commented 4 years ago

Can someone check if the latest release fixes the issue, please?

no-response[bot] commented 4 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

alikabeer32 commented 3 years ago

God damn I'm back here lol. Still not fixed I guess. Somebody helpp!!

alikabeer32 commented 3 years ago

@artf latest release doesn't fix the issue I think

artf commented 1 year ago

Closing this one as it's quite old and no reproducible demo was provide so far