Format
Last updated
Was this helpful?
Was this helpful?
{
"title": "Overlay Opacity",
"id": "overlayOpacity",
"format": "opacity-[{{value}}%]",
"slider": {
"default": 70,
"min": 0,
"max": 100
}
}{{overlayOpacity}}opacity-[70%]{
"title": "Badge Offset",
"id": "badgeOffsetX",
"format": "transform: translateX({{value}}px);",
"number": {
"default": 12
}
}{{badgeOffsetX}}transform: translateX(12px);{
"title": "Badge Offset",
"id": "badgeOffsetX",
"format": "--badgeOffsetX: {{value}}px;",
"number": {
"default": 12
}
}{{badgeOffsetX}}--badgeOffsetX: 12px;// first you would use the CSS custom property in your CSS:
<style>
.myDiv {
...
transform: scale(0.5) translateX(var(--badgeOffsetX, 0));
}
</style>
// now that your class is setup to use the --badgeOffsetX custom property
// you can reassign it locally:
<div class="myDiv" style="{{badgeOffsetX}}"> ... </div>
// this would output:
<div class="myDiv" style="--badgeOffsetX: 12px;"> ... </div>