Overview
The background-color
CSS property sets the background color of an element.
Colors
Use color
please refer to Colors.
bg:fade-60
bg:gray-60
bg:brown-60
bg:orange-60
bg:gold-60
bg:yellow-60
bg:grass-60
bg:green-60
bg:beryl-60
bg:teal-60
bg:cyan-60
bg:sky-60
bg:blue-60
bg:indigo-60
bg:violet-60
bg:purple-60
bg:fuchsia-60
bg:pink-60
bg:crimson-60
bg:red-60
Hex
bg:#878d9f
bg:#8d8d8f
bg:#af836e
bg:#d5731e
bg:#c08000
bg:#ac8a00
bg:#689c13
bg:#08a345
bg:#00a170
bg:#009f94
bg:#0099c1
bg:#0b92ee
bg:#538cee
bg:#7d84e8
bg:#9e77f5
bg:#b56cec
bg:#e04ee5
bg:#ee52a3
bg:#ea5b82
bg:#eb5f63
RGB
bg:rgb(135,141,159)
bg:rgb(141,141,143)
bg:rgb(175,131,110)
bg:rgb(213,115,30)
bg:rgb(192,128,0)
bg:rgb(172,138,0)
bg:rgb(104,156,19)
bg:rgb(8,163,69)
bg:rgb(0,161,112)
bg:rgb(0,159,148)
bg:rgb(0,153,193)
bg:rgb(11,146,238)
bg:rgb(83,140,238)
bg:rgb(125,132,232)
bg:rgb(158,119,245)
bg:rgb(181,108,236)
bg:rgb(224,78,229)
bg:rgb(238,82,163)
bg:rgb(234,91,130)
bg:rgb(235,95,99)
Applying with functions
<div class="background-color:$(value)">...</div>
Master supports native CSS variables and functions, just add var(--key)
or use shorthand$(key)
for variables.
You can also use calc(expression)
, env(expression)
and other CSS functions if the property supports it.
To learn more, see the Functions documentation.
Conditionally apply
States and selectors
<div class="background-color:fade-10:hover">...</div>
Master supports all native CSS selectors, just add :hover
, :disabled
, chaining, combinators and other CSS selectors as usual.
To learn more, see the Selectors documentation.
Responsive breakpoints
<div class="background-color:fade-10@sm">...</div>
Responsive breakpoints can be applied to all styles. Some available breakpoints are 3xs
, 2xs
, xs
, sm
,md
, lg
, xl
, 2xl
, 3xl
, 4xl
. Arbitrary breakpoints can be specified through comparison operators >
, >=
, <
, <=
.
To learn more, see the Breakpoints documentation.
Print format and media queries
<div class="background-color:fade-10@print">...</div>
Master supports media types like print
, screen
, speech
, all
, and other media queries.
To learn more, see the Media Queries documentation.
Dark mode and color schemes
<div class="background-color:fade-10@dark">...</div>
Master uses the selector html.dark
to support color schemes. Now, you can easily fine-tune your style for the color schemes.
To learn more, see the Color Schemes documentation.