Skip to content

Backgrounds

Elevate CSS features three compound properties for setting or configuring the background of an element: bg-img, bg-color, and bg-attr. bg-img and bg-color are fairly self explainatory while bg-attr is a more advanced property that can be used to configure the characteristics of the background of an element.


Setting Backgrounds

PropertyExpected ValuesExample
bg-imgPassThroughToken (e.g., (url(https://example.com/image.jpg)) )bg-img:(url(https://example.com/image.jpg))
bg-colorColorToken (e.g., purple+1)bg-color:purple+1
bg-exactPassThroughToken (e.g., (50%_auto) )bg-exact:(50%_auto)





Configuring Background Attributes

Use bg-attr with one of the following modifiers:

ModifierExpected ValuesExample
Sizecover,containbg-attr:cover
Repeatno-repeat, repeat-x, repeat-y, repeat, space, round, initial, revert, unset, revert-layerbg-attr:no-repeat
Positionleft-top, left-center, left-bottom, center-top, center, center-bottom, right-top, right-center, right-bottombg-attr:center
Attachmentscroll, fixed, localbg-attr:fixed
Clipborder, content, padding, textbg-attr:content
Originborder, content, paddingbg-attr:border