background_position Modifier

Converts an asset focal point value (eg. 50-30) into a value suitable for the background-position css property.

focus: 50-30
background-position: {{ focus | background_position }};
background-position: {{ Statamic::modify($focus)->backgroundPosition() }};
background-position: 50% 30%;
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →