Class | Properties |
---|---|
.bg-fixed | background-attachment: fixed; |
.bg-local | background-attachment: local; |
.bg-scroll | background-attachment: scroll; |
Usage
Fixed
Use .bg-fixed
to fix the background image relative to the viewport.
Local
Use .bg-local
to scroll the background image with the container and the viewport.
Scroll
Use .bg-scroll
to scroll the background image with the viewport, but not with the container.
Variants
By default, no responsive or hover-state variants are generated for background attachment utilities.
Responsive
To include responsive variants like .md:bg-fixed
, add "background-attachment"
to the $responsive-variants
variable in your theme’s _variables.scss
file when recompiling your CSS:
$responsive-variants: (
// ...
"background-attachment",
);
Hover-state
To include hover-state variants like .hover:bg-fixed
, add "background-attachment"
to the $hover-variants
variable:
$hover-variants: (
// ...
"background-attachment",
);