Skip to content

Background Size

Set background size

Syntax

visual="bg-size:[value]"

Values

ValueCSS OutputDescription
autobackground-size: autoOriginal size
coverbackground-size: coverCover container
containbackground-size: containContain 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>