docs/api/property.md
id String Property id, eg. my-property-id.property String Related CSS property name, eg. text-align.default String Defaul value of the property.label String Label to use in UI, eg. Text Align.onChange Function? Change callback.
onChange: ({ property, from, to }) => {
console.log(`Changed property`, property.getName(), { from, to });
}
Get property id.
Returns String
Get the property type.
The type of the property is defined on property creation and based on its value the proper Property class is assigned.
The default type is base.
Returns String
Get name (the CSS property name).
Returns String
Get property label.
opts Object Options (optional, default {})
opts.locale Boolean Use the locale string from i18n module (optional, default true)Returns String
Get property value.
opts Object Options (optional, default {})
opts.noDefault Boolean Avoid returning the default value (optional, default false)Returns String
Check if the property has value.
opts Object Options (optional, default {})
opts.noParent Boolean Ignore the value if it comes from the parent target. (optional, default false)Returns Boolean
Indicates if the current value is coming from a parent target (eg. another CSSRule).
Returns Boolean
Get the CSS style object of the property.
opts Object Options (optional, default {})
opts.camelCase Boolean? Return property name in camelCase.// In case the property is `color` with a value of `red`.
console.log(property.getStyle());
// { color: 'red' };
Returns Object
Get the default value.
Returns string
Update the value. The change is also propagated to the selected targets (eg. CSS rule).
Check if the property is visible
Returns Boolean
Clear the value. The change is also propagated to the selected targets (eg. the css property is cleared).
opts Object Options (optional, default {})
opts.noTarget Boolean If true the change won't be propagated to selected targets. (optional, default false)Indicates if the current value comes directly from the selected target and so can be cleared.
Returns Boolean
If the current property is a sub-property, this will return the parent Property.
Returns ([Property] | null)
Indicates if the property is full-width in UI.
Returns Boolean