Colors
Color utilities for text, backgrounds, and borders - generated from the $theme-colors map. Every color token produces .text-*, .fg-*, and .bg-* utilities automatically.
Color palette
The full set of theme colors available across all color utilities.
28 theme colors total. Semantic tokens (primary,secondary,success,info,warning,danger,light,dark) sit alongside a full Material-style palette (red,pink,purple,deeppurple,indigo,blue,lightblue,cyan,teal,green,lightgreen,lime,yellow,amber,orange,deeporange,brown,grey,black,white) - every one generates matching.text-*/.fg-*,.bg-*,.border-*,.link-*, and.gradient-*utilities.
Text colors
Apply a foreground color to text using .text-{color} or the alias .fg-{color} - both classes generate the same output.
Preview
<p class="text-primary">Primary text</p>
<p class="text-danger">Danger text</p>
<p class="fg-success">Success text (alias)</p>
| Class | Alias | Color | Value |
|---|---|---|---|
.text-primary | .fg-primary | primary | #03A9F4 |
.text-secondary | .fg-secondary | secondary | #333333 |
.text-success | .fg-success | success | #28a745 |
.text-info | .fg-info | info | #0DCAF0 |
.text-warning | .fg-warning | warning | #FFC107 |
.text-danger | .fg-danger | danger | #DC3545 |
.text-light | .fg-light | light | #f5f5f5 |
.text-dark | .fg-dark | dark | #212529 |
.text-red | .fg-red | red | #F44336 |
.text-green | .fg-green | green | #4CAF50 |
.text-blue | .fg-blue | blue | #2196F3 |
.text-black | .fg-black | black | #000000 |
.text-white | .fg-white | white | #ffffff |
.text-pink | .fg-pink | pink | #E91E63 |
.text-purple | .fg-purple | purple | #9C27B0 |
.text-indigo | .fg-indigo | indigo | #3E51B5 |
.text-cyan | .fg-cyan | cyan | #00BCD4 |
.text-teal | .fg-teal | teal | #009688 |
.text-lime | .fg-lime | lime | #CDDC39 |
.text-yellow | .fg-yellow | yellow | #FFEB3B |
.text-amber | .fg-amber | amber | #FFC107 |
.text-orange | .fg-orange | orange | #FF9800 |
.text-lightblue | .fg-lightblue | lightblue | #03A9F4 |
.text-lightgreen | .fg-lightgreen | lightgreen | #76FF03 |
.text-deeppurple | .fg-deeppurple | deeppurple | #673AB7 |
.text-deeporange | .fg-deeporange | deeporange | #DD6E0F |
.text-brown | .fg-brown | brown | #964B00 |
.text-grey | .fg-grey | grey | #808080 |
Background colors
Set an element's background color with .bg-{color}.
Preview
<div class="bg-primary text-white px-4 py-2">Primary</div>
<div class="bg-success text-white px-4 py-2">Success</div>
<div class="bg-danger text-white px-4 py-2">Danger</div>
| Class | Color | Value |
|---|---|---|
.bg-primary | primary | #03A9F4 |
.bg-secondary | secondary | #333333 |
.bg-success | success | #28a745 |
.bg-info | info | #0DCAF0 |
.bg-warning | warning | #FFC107 |
.bg-danger | danger | #DC3545 |
.bg-light | light | #f5f5f5 |
.bg-dark | dark | #212529 |
.bg-red | red | #F44336 |
.bg-green | green | #4CAF50 |
.bg-blue | blue | #2196F3 |
.bg-black | black | #000000 |
.bg-white | white | #ffffff |
.bg-pink | pink | #E91E63 |
.bg-purple | purple | #9C27B0 |
.bg-indigo | indigo | #3E51B5 |
.bg-cyan | cyan | #00BCD4 |
.bg-teal | teal | #009688 |
.bg-lime | lime | #CDDC39 |
.bg-yellow | yellow | #FFEB3B |
.bg-amber | amber | #FFC107 |
.bg-orange | orange | #FF9800 |
.bg-lightblue | lightblue | #03A9F4 |
.bg-lightgreen | lightgreen | #76FF03 |
.bg-deeppurple | deeppurple | #673AB7 |
.bg-deeporange | deeporange | #DD6E0F |
.bg-brown | brown | #964B00 |
.bg-grey | grey | #808080 |
Hover variants
Prefix any color utility with hover: to apply it only on mouse hover. Works for both text and background colors.
<!-- Text turns primary on hover -->
<a class="text-secondary hover:text-primary" href="#">Hover me</a>
<!-- Background shifts to danger on hover -->
<button class="bg-primary hover:bg-danger text-white px-4 py-2">
Delete
</button>
<!-- Combine text and background hover -->
<div class="bg-light hover:bg-primary text-dark hover:text-white px-3 py-2 rounded">
Card
</div>
All color names are supported. Every token in$theme-colorsgenerates ahover:text-{color}andhover:bg-{color}variant - no extra configuration needed.
Custom colors
ArchCSS is built from SCSS, and a future release will let you override any theme color or extend the palette by redefining variables before importing the source. All utilities would regenerate from your custom map automatically.
Coming soon. SCSS source customization isn't part of the public package yet - the snippets below preview how it will work once it ships.
Override a single token
// Change the primary brand color
$primary: #6366f1;
@use 'archcss/src/scss/index';
Extend the theme-colors map
Add entirely new color tokens by merging into $theme-colors:
// Add custom colors to the palette
$theme-colors: (
"primary" : #6366f1,
"accent" : #f59e0b,
"brand" : #10b981,
);
@use 'archcss/src/scss/index';
Note: Defining$theme-colorsreplaces the default map. To keep the built-in colors and add new ones, use the SCSSmap.merge()function or define your overrides before the@usestatement using thewithclause.