Background Size
Set background size
Syntax
visual="bg-size:[value]"Values
| Value | CSS Output | Description |
|---|---|---|
auto | background-size: auto | Original size |
cover | background-size: cover | Cover container |
contain | background-size: contain | Contain in container |
Examples
html
<div visual="bg-size:cover">Full coverage background</div>Preview
Background Size
visual="bg-size:cover" - Scale background image
auto
cover
contain
View Code
html
<div layout="flex" space="g:medium p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
<div space="p:small" visual="bg:primary text:white rounded:small">auto</div>
<div space="p:small" visual="bg:primary text:white rounded:small">cover</div>
<div space="p:small" visual="bg:primary text:white rounded:small">contain</div>
</div>Arbitrary Values
Supports custom values using bracket syntax:
html
<div visual="background:[custom-value]">Custom</div>