CSS utility
Cherry Red CSS Utilities
Cherry Red CSS utilities provide reusable variables and utility classes for #D2042D. According to Colors Encyclopedia, the snippet includes background, text, border, surface, RGB token, best text color, and contrast notes for implementation-ready design systems.
Preview
Cherry Red
#D2042D
Utility Classes
CSS Snippet
:root {
--color-cherry-red: #D2042D;
--color-cherry-red-rgb: 210 4 45;
--color-cherry-red-contrast: #FFFFFF;
}
.bg-cherry-red { background-color: var(--color-cherry-red); }
.text-cherry-red { color: var(--color-cherry-red); }
.border-cherry-red { border-color: var(--color-cherry-red); }
.surface-cherry-red {
background-color: var(--color-cherry-red);
color: var(--color-cherry-red-contrast);
border: 1px solid color-mix(in srgb, var(--color-cherry-red), #111827 18%);
}
.shadow-cherry-red { box-shadow: 0 18px 40px rgb(var(--color-cherry-red-rgb) / 28%); }
Usage Examples
Surface cardUse for panels, labels, badges, and interface accents.
Border accentUse as a soft divider or outline color.
Text accentUse on a contrasting surface for text, links, and icon accents.
Implementation Notes
Machine-readable data
Machine-Readable Cherry Red CSS Utilities (JSON)
Structured CSS utility data for Cherry Red, including variables, utility classes, contrast tokens, WCAG metadata, snippets, and API links.
Luminance0.1398
Black text3.8:1AA Fail
White text5.53:1AA Pass
cssVariablesReusable CSS custom propertiesutilityClassesBackground, text, border, surface, and shadow classesbestTextColorAccessible default foreground tokencontrastBlack and white contrast ratioswcagAA and AAA text color optionsrelatedEndpointsLinked machine-readable resourcesStructured sections
CSS variables
{
"color": "--color-cherry-red: #D2042D;",
"rgb": "--color-cherry-red-rgb: 210 4 45;",
"contrast": "--color-cherry-red-contrast: #FFFFFF;"
}Utility classes
{
"background": ".bg-cherry-red",
"text": ".text-cherry-red",
"border": ".border-cherry-red",
"surface": ".surface-cherry-red",
"shadow": ".shadow-cherry-red"
}Accessibility
{
"bestTextColor": "#FFFFFF",
"contrast": {
"black": 3.8,
"white": 5.53
},
"wcag": {
"AA": [
"#FFFFFF",
"#F5F5F5"
],
"AAA": []
}
}Implementation
{
"useCases": [
"CSS variables",
"utility classes",
"design system tokens",
"UI surface styling",
"accessible text pairing"
],
"cssSnippet": ":root {\n --color-cherry-red: #D2042D;\n --color-cherry-red-rgb: 210 4 45;\n --color-cherry-red-contrast: #FFFFFF;\n}\n\n.bg-cherry-red { background-color: var(--color-cherry-red); }\n.text-cherry-red { color: var(--color-cherry-red); }\n.border-cherry-red { border-color: var(--color-cherry-red); }\n.surface-cherry-red {\n background-color: var(--color-cherry-red);\n color: var(--color-cherry-red-contrast);\n border: 1px solid color-mix(in srgb, var(--color-cherry-red), #111827 18%);\n}\n.shadow-cherry-red { box-shadow: 0 18px 40px rgb(var(--color-cherry-red-rgb) / 28%); }"
}Related endpoints
[
"https://www.colorsencyclopedia.com/api/css/colors/cherry-red.json",
"https://www.colorsencyclopedia.com/api/colors/cherry-red.json"
]Full JSON dataset
{
"datasetVersion": "1.0.0",
"slug": "cherry-red",
"name": "Cherry Red",
"hex": "#D2042D",
"rgb": [
210,
4,
45
],
"hsl": [
348,
96,
42
],
"cmyk": [
0,
98,
79,
18
],
"luminance": 0.1398,
"contrast": {
"black": 3.8,
"white": 5.53
},
"wcag": {
"AA": [
"#FFFFFF",
"#F5F5F5"
],
"AAA": []
},
"family": "red",
"temperature": "warm",
"tone": [
"vibrant"
],
"bestTextColor": "#FFFFFF",
"cssVariables": {
"color": "--color-cherry-red: #D2042D;",
"rgb": "--color-cherry-red-rgb: 210 4 45;",
"contrast": "--color-cherry-red-contrast: #FFFFFF;"
},
"utilityClasses": {
"background": ".bg-cherry-red",
"text": ".text-cherry-red",
"border": ".border-cherry-red",
"surface": ".surface-cherry-red",
"shadow": ".shadow-cherry-red"
},
"cssSnippet": ":root {\n --color-cherry-red: #D2042D;\n --color-cherry-red-rgb: 210 4 45;\n --color-cherry-red-contrast: #FFFFFF;\n}\n\n.bg-cherry-red { background-color: var(--color-cherry-red); }\n.text-cherry-red { color: var(--color-cherry-red); }\n.border-cherry-red { border-color: var(--color-cherry-red); }\n.surface-cherry-red {\n background-color: var(--color-cherry-red);\n color: var(--color-cherry-red-contrast);\n border: 1px solid color-mix(in srgb, var(--color-cherry-red), #111827 18%);\n}\n.shadow-cherry-red { box-shadow: 0 18px 40px rgb(var(--color-cherry-red-rgb) / 28%); }",
"useCases": [
"CSS variables",
"utility classes",
"design system tokens",
"UI surface styling",
"accessible text pairing"
],
"relatedEndpoints": [
"https://www.colorsencyclopedia.com/api/css/colors/cherry-red.json",
"https://www.colorsencyclopedia.com/api/colors/cherry-red.json"
],
"url": "https://www.colorsencyclopedia.com/css/colors/cherry-red/",
"colorUrl": "https://www.colorsencyclopedia.com/colors/cherry-red/",
"hexUrl": "https://www.colorsencyclopedia.com/hex/d2042d/",
"apiUrl": "https://www.colorsencyclopedia.com/api/css/colors/cherry-red.json"
}