Colors

Utilities for colors.

Mojo provides pre-defined colors with limitless tints and shades that can be utilized for every CSS color property. learn more in Color System

Pre-Defined values

Here's a list of predefined values that work for all color utilities:

valuecss
current[property-color]: currentColor
inherit[property-color]: inherit
initial[property-color]: initial
transparent[property-color]: transparent

Background Color

Using bg-c-[*] or bg-c-[*]:[shade|tint], you can control the color of an element's background.

bg-c-
You can use Arbitrary color values like "bg-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Background Alpha

Using bg-c-[*][alpha], you can control the alpha channel (transparency) of an element's background color. The alpha value should fall within a range of 1 to 100.

bg-c-
If you want to change the alpha value on its own, utilize the syntax bg-alpha-[*], such as bg-alpha-35.

Text Color

Using text-c-[*] or text-c-[*]:[shade|tint], you can control the color of an element's text.

text-c-
Life is magical, embrace it with open arms.
You can use Arbitrary color values like "text-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Text Alpha

Using text-c-[*][alpha], you can control the alpha channel (transparency) of an element's text color. The alpha value should fall within a range of 1 to 100.

text-c-
Life is magical, embrace it with open arms.
If you want to change the alpha value on its own, utilize the syntax text-alpha-[*], such as "text-alpha-35".

Border Color

Using border-c-[*] or border-c-[*]:[shade|tint], you can control the color of an element's border.

border-c-
You can use Arbitrary color values like "border-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Border Alpha

Using border-c-[*][alpha], you can control the alpha channel (transparency) of an element's border color. The alpha value should fall within a range of 1 to 100.

border-c-
If you want to change the alpha value on its own, utilize the syntax border-alpha-[*], such as "border-alpha-35".

Side Colors

Using border-[side]-c-[*], you can set the border color for one side of an element.

border-
If you want to change the alpha value, utilize the syntax border-[side]-c-color[*], such as "border-top-c-red[40]".

Outline Color

Using outline-c-[*] or outline-c-[*]:[shade|tint], you can control the color of an element's border.

outline-c-
You can use Arbitrary color values like "outline-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Outline Alpha

Using outline-c-[*][alpha], you can control the alpha channel (transparency) of an element's outline color. The alpha value should fall within a range of 1 to 100.

outline-c-
If you want to change the alpha value on its own, utilize the syntax outline-alpha-[*], such as "outline-alpha-35".

Shadow Color

Using shadow-c-[*] or shadow-c-[*]:[shade|tint], you can control the color of an element's box-shadow.

shadow-c-
You can use Arbitrary color values like "shadow-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Shadow Alpha

Using shadow-c-[*][alpha], you can control the alpha channel (transparency) of an element's shadow color. The alpha value should fall within a range of 1 to 100.

shadow-c-
If you want to change the alpha value on its own, utilize the syntax shadow-alpha-[*], such as "shadow-alpha-35".

Fill Color

Using fill-c-[*] or fill-c-[*]:[shade|tint], you can control the fill color of an SVG.

fill-c-
You can use Arbitrary color values like "fill-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Fill Alpha

Using fill-c-[*][alpha], you can control the alpha channel (transparency) of an SVG's fill color. The alpha value should fall within a range of 1 to 100.

fill-c-
If you want to change the alpha value on its own, utilize the syntax fill-alpha-[*], such as "fill-alpha-35".

Stroke Color

Using stroke-c-[*] or stroke-c-[*]:[shade|tint], you can control the stroke color of an SVG.

stroke-c-
You can use Arbitrary color values like "stroke-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Stroke Alpha

Using stroke-c-[*][alpha], you can control the alpha channel (transparency) of an SVG's stroke color. The alpha value should fall within a range of 1 to 100.

stroke-c-
If you want to change the alpha value on its own, utilize the syntax stroke-alpha-[*], such as "stroke-alpha-35".

Accent Color

Using accent-c-[*] or accent-c-[*]:[shade|tint], you can control the accent color of an element's box-shadow. This utility enables developers to customize the look of elements like checkboxes and radio groups by replacing the browser's default color.

accent-c-
You can use Arbitrary color values like "accent-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Accent Alpha

Using accent-c-[*][alpha], you can control the alpha channel (transparency) of an element's accent color. The alpha value should fall within a range of 1 to 100.

Currently, the only browser that allows you to change the alpha value for accent color is Firefox.
accent-c-
If you want to change the alpha value on its own, utilize the syntax accent-alpha-[*], such as "accent-alpha-35".

Caret Color

Using caret-c-[*] or caret-c-[*]:[shade|tint], you can control the color of text input cursor.

caret-c-
Focus the input to see the caret color
You can use Arbitrary color values like "caret-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Caret Alpha

Using caret-c-[*][alpha], you can control the alpha channel (transparency) of an input's text input cursor color. The alpha value should fall within a range of 1 to 100.

caret-c-
Focus the input to see the caret color
If you want to change the alpha value on its own, utilize the syntax caret-alpha-[*], such as "caret-alpha-35".

Placeholder Color

Using placeholder-c-[*] or placeholder-c-[*]:[shade|tint], you can control the text color of an input's placeholder.

placeholder-c-
You can use Arbitrary color values like "placeholder-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Placeholder Alpha

Using placeholder-c-[*][alpha], you can control the alpha channel (transparency) of an input's placeholder text color. The alpha value should fall within a range of 1 to 100.

placeholder-c-
If you want to change the alpha value on its own, utilize the syntax placeholder-alpha-[*], such as "placeholder-alpha-35".

Gradient Colors

In order to give an element a gradient background color, it is necessary to begin with the bg-gradient utility before proceeding to the color stops utilities.


<div class="-- bg-gradient ** ...">
    <!-- ... -->
</div>

Then, you must specify both the start and end color stops. Adding of a middle color stop is up to you.


<div class="bg-gradient -- start-c-blue ** mid-c-red -- end-c-green **">
    <!-- ... -->
</div>

Start Color

Using start-c-[*] or start-c-[*]:[shade|tint], you can control the gradient's starting color stop.

start-c-

Middle Color

Using mid-c-[*] or mid-c-[*]:[shade|tint], you can control the gradient's middle color stop.

mid-c-

End Color

Using end-c-[*] or end-c-[*]:[shade|tint], you can control the gradient's ending color stop.

end-c-
Using `start-c-[*][alpha]`, `mid-c-[*][alpha]` and `end-c-[*][alpha]` you can control the alpha channel (transparency) of gradients color stops. The alpha value should fall within a range of 1 to 100.
You can use Arbitrary color values like "start-c-(#344224)" as well.
Learn more about Arbitrary Styling
Supported Arbitrary color values are HEX, RGB, RGBA, HSL, HSA.

Gradient Direction

Using gd-dir-[*], you can change the direction of gradient.

gd-dir-
You can use Arbitrary color values like "gd-dir-(45deg)" or "gd-dir-(top_25deg)" as well.
Learn more about Arbitrary Styling