CSS utility

Yellow CSS Utilities

Yellow CSS utilities provide reusable variables and utility classes for #FFFF00. 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 Yellow #FFFF00

Utility Classes

Background.bg-yellow
Text.text-yellow
Border.border-yellow
Surface.surface-yellow

CSS Snippet

:root {
  --color-yellow: #FFFF00;
  --color-yellow-rgb: 255 255 0;
  --color-yellow-contrast: #111827;
}

.bg-yellow { background-color: var(--color-yellow); }
.text-yellow { color: var(--color-yellow); }
.border-yellow { border-color: var(--color-yellow); }
.surface-yellow {
  background-color: var(--color-yellow);
  color: var(--color-yellow-contrast);
  border: 1px solid color-mix(in srgb, var(--color-yellow), #111827 18%);
}
.shadow-yellow { box-shadow: 0 18px 40px rgb(var(--color-yellow-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

Best text color#111827
Black contrast19.56:1
White contrast1.07:1
RGB token255 255 0

Machine-readable data

Machine-Readable Yellow CSS Utilities (JSON)

Structured CSS utility data for Yellow, including variables, utility classes, contrast tokens, WCAG metadata, snippets, and API links.

AI-Ready Dataset v1.0.0
Luminance0.9278
Black text19.56:1AA Pass
White text1.07:1AA Fail
cssVariablesReusable CSS custom properties
utilityClassesBackground, text, border, surface, and shadow classes
bestTextColorAccessible default foreground token
contrastBlack and white contrast ratios
wcagAA and AAA text color options
relatedEndpointsLinked machine-readable resources
Download JSON Open API
Structured sections
CSS variables
{
  "color": "--color-yellow: #FFFF00;",
  "rgb": "--color-yellow-rgb: 255 255 0;",
  "contrast": "--color-yellow-contrast: #111827;"
}
Utility classes
{
  "background": ".bg-yellow",
  "text": ".text-yellow",
  "border": ".border-yellow",
  "surface": ".surface-yellow",
  "shadow": ".shadow-yellow"
}
Accessibility
{
  "bestTextColor": "#111827",
  "contrast": {
    "black": 19.56,
    "white": 1.07
  },
  "wcag": {
    "AA": [
      "#000000",
      "#1A1A1A",
      "#36454F"
    ],
    "AAA": [
      "#000000",
      "#1A1A1A",
      "#36454F"
    ]
  }
}
Implementation
{
  "useCases": [
    "CSS variables",
    "utility classes",
    "design system tokens",
    "UI surface styling",
    "accessible text pairing"
  ],
  "cssSnippet": ":root {\n  --color-yellow: #FFFF00;\n  --color-yellow-rgb: 255 255 0;\n  --color-yellow-contrast: #111827;\n}\n\n.bg-yellow { background-color: var(--color-yellow); }\n.text-yellow { color: var(--color-yellow); }\n.border-yellow { border-color: var(--color-yellow); }\n.surface-yellow {\n  background-color: var(--color-yellow);\n  color: var(--color-yellow-contrast);\n  border: 1px solid color-mix(in srgb, var(--color-yellow), #111827 18%);\n}\n.shadow-yellow { box-shadow: 0 18px 40px rgb(var(--color-yellow-rgb) / 28%); }"
}
Related endpoints
[
  "https://www.colorsencyclopedia.com/api/css/colors/yellow.json",
  "https://www.colorsencyclopedia.com/api/colors/yellow.json"
]
Full JSON dataset
{
  "datasetVersion": "1.0.0",
  "slug": "yellow",
  "name": "Yellow",
  "hex": "#FFFF00",
  "rgb": [
    255,
    255,
    0
  ],
  "hsl": [
    60,
    100,
    50
  ],
  "cmyk": [
    0,
    0,
    100,
    0
  ],
  "luminance": 0.9278,
  "contrast": {
    "black": 19.56,
    "white": 1.07
  },
  "wcag": {
    "AA": [
      "#000000",
      "#1A1A1A",
      "#36454F"
    ],
    "AAA": [
      "#000000",
      "#1A1A1A",
      "#36454F"
    ]
  },
  "family": "yellow",
  "temperature": "warm",
  "tone": [
    "vibrant"
  ],
  "bestTextColor": "#111827",
  "cssVariables": {
    "color": "--color-yellow: #FFFF00;",
    "rgb": "--color-yellow-rgb: 255 255 0;",
    "contrast": "--color-yellow-contrast: #111827;"
  },
  "utilityClasses": {
    "background": ".bg-yellow",
    "text": ".text-yellow",
    "border": ".border-yellow",
    "surface": ".surface-yellow",
    "shadow": ".shadow-yellow"
  },
  "cssSnippet": ":root {\n  --color-yellow: #FFFF00;\n  --color-yellow-rgb: 255 255 0;\n  --color-yellow-contrast: #111827;\n}\n\n.bg-yellow { background-color: var(--color-yellow); }\n.text-yellow { color: var(--color-yellow); }\n.border-yellow { border-color: var(--color-yellow); }\n.surface-yellow {\n  background-color: var(--color-yellow);\n  color: var(--color-yellow-contrast);\n  border: 1px solid color-mix(in srgb, var(--color-yellow), #111827 18%);\n}\n.shadow-yellow { box-shadow: 0 18px 40px rgb(var(--color-yellow-rgb) / 28%); }",
  "useCases": [
    "CSS variables",
    "utility classes",
    "design system tokens",
    "UI surface styling",
    "accessible text pairing"
  ],
  "relatedEndpoints": [
    "https://www.colorsencyclopedia.com/api/css/colors/yellow.json",
    "https://www.colorsencyclopedia.com/api/colors/yellow.json"
  ],
  "url": "https://www.colorsencyclopedia.com/css/colors/yellow/",
  "colorUrl": "https://www.colorsencyclopedia.com/colors/yellow/",
  "hexUrl": "https://www.colorsencyclopedia.com/hex/ffff00/",
  "apiUrl": "https://www.colorsencyclopedia.com/api/css/colors/yellow.json"
}