Issue #2137Opened July 14, 2019by alikabeer320 reactions

[help needed] Can someone explain property.layers of the style manager? [pls read description]

Question

I would like to code the entire background layers property but this time using 'background' instead of background-image so it doesn't mess up the gradient but unfortunately can't bring background-position, background-size, etc to work.

        var property = editor.StyleManager.addProperty('decorations',{
          name: 'Background Image',
          property: 'background',
          type: 'stack',
          properties:[
            {
              name:'Background',
              functionName:'url',
              type:'file'
            },{
              name: 'Background Position',
              property: 'background-position',
              type: 'select',
              list: [{
                value: 'left top',
                name: 'left top',
               },{
                value: 'left center',
                name: 'left center',
               },{
                value: 'left bottom',
                name: 'left bottom',
               },{
                value: 'right top',
                name: 'right top',
               },{
                value: 'right center',
                name: 'right center',
               },{
                value: 'right bottom',
                name: 'right bottom',
               },{
                value: 'center top',
                name: 'center top',
               },{
                value: 'center center',
                name: 'center center',
               },{
                value: 'center bottom',
                name: 'center bottom',
               }],
            },{
              name: 'Background Repeat',
              property: 'background-repeat',
              type: 'select',
              list: [{
                value: 'repeat',
                name: 'repeat',
               },{
                value: 'repeat-x',
                name: 'repeat-x',
               },{
                value: 'repeat-y',
                name: 'repeat-y',
               },{
                value: 'no-repeat',
                name: 'no-repeat',
               }],
            },{
              name: 'Background Attachment',
              property: 'background-attachment',
              type: 'select',
              list: [{
                value: 'scroll',
                name: 'scroll',
               },{
                value: 'fixed',
                name: 'fixed',
               },{
                value: 'local',
                name: 'local',
               }],
            }
          ]
        });

but the result is something like this -> background: url(../assets/347f05a7ef54b27632187b38a1ddfe65) left top repeat; }

Answers (3)

alikabeer32July 15, 20190 reactions

@artf It did work. Now I corrected the order -> background: url(../assets/05efe94654acb49683023f16e5cefce7) left center / cover no-repeat fixed;

But when I deselect and select the component again, those values ( left center / cover no-repeat fixed) appear empty in the style manager panel.

alikabeer32July 15, 20190 reactions

panel

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.