Skip to main content

Overview

Control text color with semantic color utilities. All text color utilities are designed to meet WCAG accessibility standards and work seamlessly with Elementor v4’s Global Classes system.

Text Color Utilities

ClassColorHexCSSUsage
.text-whiteWhite#ffffffcolor: #ffffff;Text on dark backgrounds
.text-blackBlack#000000color: #000000;Primary text
.text-gray-darkDark Gray#374151color: #374151;Primary text
.text-grayGray#6b7280color: #6b7280;Secondary text
.text-gray-lightLight Gray#9ca3afcolor: #9ca3af;Muted text
.text-blueBlue#3b82f6color: #3b82f6;Links, primary actions
.text-greenGreen#10b981color: #10b981;Success messages
.text-redRed#ef4444color: #ef4444;Error messages
.text-yellowYellow#f59e0bcolor: #f59e0b;Warning messages

Examples

<!-- Text color examples -->
<h1 class="text-3xl font-bold text-black">Primary Heading</h1>
<p class="text-base text-gray">Secondary text content</p>
<a href="#" class="text-blue underline">Link text</a>
<div class="text-green">Success message</div>
<div class="text-red">Error message</div>
<div class="text-yellow">Warning message</div>

Common Patterns

Heading Hierarchy

<h1 class="text-4xl font-bold text-black">Main Heading</h1>
<h2 class="text-2xl font-semibold text-gray-dark">Section Heading</h2>
<p class="text-base text-gray">Body text content</p>

Status Messages

<div class="text-green">✓ Success: Operation completed</div>
<div class="text-red">✗ Error: Something went wrong</div>
<div class="text-yellow">⚠ Warning: Please check this</div>
<a href="#" class="text-blue underline">Primary link</a>
<a href="#" class="text-gray hover:text-blue">Secondary link</a>

Color Combinations

High Contrast Text

<!-- High contrast combinations -->
<div class="bg-black text-white p-6">Black background, white text</div>
<div class="bg-white text-black p-6 border border-black">White background, black text</div>
<div class="bg-blue text-white p-6">Blue background, white text</div>

Subtle Text Colors

<!-- Subtle combinations -->
<div class="bg-white text-gray-dark p-6">White background, dark gray text</div>
<div class="bg-gray-light text-gray p-6">Light gray background, gray text</div>
<div class="bg-white text-gray-light p-6">White background, light gray text</div>

Accessibility

Accessibility Note: Ensure sufficient color contrast for readability. Text colors are designed to meet WCAG AA standards when used with appropriate backgrounds.

Contrast Guidelines

  • Normal text: Minimum 4.5:1 contrast ratio
  • Large text: Minimum 3:1 contrast ratio
  • UI components: Minimum 3:1 contrast ratio
  • Focus indicators: Minimum 3:1 contrast ratio

Best Practices

  • Use semantic colors: Choose colors that match their meaning (green for success, red for errors)
  • Maintain hierarchy: Use darker colors for primary text, lighter for secondary
  • Test contrast: Always verify text is readable on its background
  • Consider context: Choose colors that work with your brand and content