Backgrounds
The Background Utilities provide advanced control over color, gradients, repeating, positioning, sizing, origins, and attachments for backgrounds — fully compatible with both Bootstrap and your custom design system (light & dark modes).
All classes use the al- prefix and follow utility-first conventions.
Overview
| Utility Group | Class Format | Description |
|---|---|---|
| Bootstrap Colors | .bg-{color} | Bootstrap native colors |
| Both-Mode Colors | .al-bg-{color}-both | Custom safe colors for both modes |
| Gradient Backgrounds | .al-bg-{type}-{color} | Linear, Radial, Conic gradients |
| Repeat | .al-bg-repeat{type} | Background repeating |
| Position | .al-bg-position-{position} | Positioning |
| Origin | .al-bg-origin-{origin} | Origin box |
| Size | .al-bg-size-{size} | Contain, cover, auto |
| Attachment | .al-bg-attachment-{type} | Fixed, local, scroll |
Sass Reference
.al-bg {
-primary-both { background-color: $primary-dark !important; }
-white-both { background-color: #fff !important; }
-black-both { background-color: #000 !important; }
}
Class Usage Reference
| Class | Output |
|---|---|
| .bg-primary | Bootstrap color |
| .al-bg-primary-both | $primary-dark |
| .al-bg-white-both | #fff |
| .al-bg-black-both | #000 |
| .al-bg-linear-primary | Linear gradient |
| .al-bg-radial-white | Radial gradient |
| .al-bg-conic-white | Conic gradient |
| .al-bg-repeat-no | No repeat |
| .al-bg-position-center-top | Center top |
| .al-bg-origin-padding | Padding box |
| .al-bg-size-cover | Cover size |
| .al-bg-attachment-fixed | Attachment fixed |
Examples
Solid Background (Both Mode)
Gradient Background
Linear Gradient
Radial Gradient
Conic Gradient
// Linear Gradient
Background attachment
Fixed
Local
Scroll
Background origin
Border
Padding
Content
Background Position
Right
Right Top
Right Bottom
Left
Left Top
Left Bottom
Center
Center Top
Center Right
Center Bottom
Center Left
Top
Bottom
Background repeat
Repeat
No-repeat
Repeat-x
Repeat-y
Background size
Contain
Cover
Auto
Developer Notes
-
Bootstrap native colors fully supported via .bg-{color} classes.
-
Your both-mode solid color layer uses .al-bg-{color}-both classes.
-
Gradient utilities provide linear, radial, and conic control.
-
Repeat, Position, Origin, Size, and Attachment are fully separated utilities for modular control.
-
Fully compatible with light and dark mode automatically.
-
Utilities generated via Sass nested structures for easy extension.