Background

Background Color

Can I use ?Can I use ?
classproperties
background-color:color / background:color / bg:colorbackground-color: color
bg:#hexbackground-color: #hex
bg:rgb(rgb)background-color: rgb(rgb)
bg:hsl(hsl)background-color: hsl(hsl)
bg:transparentbackground-color: transparent

Overview

The background-color CSS property sets the background color of an element.

Colors

Use color please refer to Colors.

Aa
bg:fade-60
Aa
bg:gray-60
Aa
bg:brown-60
Aa
bg:orange-60
Aa
bg:gold-60
Aa
bg:yellow-60
Aa
bg:grass-60
Aa
bg:green-60
Aa
bg:beryl-60
Aa
bg:teal-60
Aa
bg:cyan-60
Aa
bg:sky-60
Aa
bg:blue-60
Aa
bg:indigo-60
Aa
bg:violet-60
Aa
bg:purple-60
Aa
bg:fuchsia-60
Aa
bg:pink-60
Aa
bg:crimson-60
Aa
bg:red-60

Hex

Aa
bg:#878d9f
Aa
bg:#8d8d8f
Aa
bg:#af836e
Aa
bg:#d5731e
Aa
bg:#c08000
Aa
bg:#ac8a00
Aa
bg:#689c13
Aa
bg:#08a345
Aa
bg:#00a170
Aa
bg:#009f94
Aa
bg:#0099c1
Aa
bg:#0b92ee
Aa
bg:#538cee
Aa
bg:#7d84e8
Aa
bg:#9e77f5
Aa
bg:#b56cec
Aa
bg:#e04ee5
Aa
bg:#ee52a3
Aa
bg:#ea5b82
Aa
bg:#eb5f63

RGB

Aa
bg:rgb(135,141,159)
Aa
bg:rgb(141,141,143)
Aa
bg:rgb(175,131,110)
Aa
bg:rgb(213,115,30)
Aa
bg:rgb(192,128,0)
Aa
bg:rgb(172,138,0)
Aa
bg:rgb(104,156,19)
Aa
bg:rgb(8,163,69)
Aa
bg:rgb(0,161,112)
Aa
bg:rgb(0,159,148)
Aa
bg:rgb(0,153,193)
Aa
bg:rgb(11,146,238)
Aa
bg:rgb(83,140,238)
Aa
bg:rgb(125,132,232)
Aa
bg:rgb(158,119,245)
Aa
bg:rgb(181,108,236)
Aa
bg:rgb(224,78,229)
Aa
bg:rgb(238,82,163)
Aa
bg:rgb(234,91,130)
Aa
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.

<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.


© Aoyue Design LLC.
Issue on this page
Edited byAronLola