$w.StyleMixin

$w.StyleMixin

Provides functionality for elements that can be styled.

Contents

style Gets an object containing information about the element's styles.
style

style

Gets an object containing information about the element's styles.

Syntax

get style(): Style

Type

Style

Examples

Set the background color

JHcoIiNteUVsZW1lbnQiKS5zdHlsZS5iYWNrZ3JvdW5kQ29sb3IgPSAicmdiYSgyNTUsMCwwLDAuNSkiOwo=
$w("#myElement").style.backgroundColor = "rgba(255,0,0,0.5)";

Get the background color

bGV0IGJnQ29sb3IgPSAkdygiI215RWxlbWVudCIpLnN0eWxlLmJhY2tncm91bmRDb2xvcjsK
let bgColor = $w("#myElement").style.backgroundColor;