[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)
@alikabeer32 if the background property doesn't work probably the order of inner properties is wrong. Check the syntax here: https://developer.mozilla.org/en-US/docs/Web/CSS/background#Syntax
@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.

Related Questions and Answers
Continue research with similar issue discussions.
Issue #2138
[BUG] Gradient plugin is interfering with background-image
The background-image url is getting wrapper around by linear-gradient() function like so Even though I assigned gradient to 'background' pr...
Issue #3335
Creating trait with Style Manager property UI
I have a component using the background-url Style Manager property: I would like to reuse this UI that is shown in the Style Manager for a...
Issue #2026
[Feature request] style manager css functions (for example transform: rotate(90deg)) accepts only one parameter
I would like to provide an option for the css function translate(x,y) but the addProperty parameter functionName accepts only one parameter...
Issue #2849
[BUG] Using image url for background-image is not working properly
DescriptionOn our project for images assets we use url instead of base64 code .Expected behavior When setting a background-image to a contr...
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.