{"id":864,"date":"2026-11-23T13:00:07","date_gmt":"2026-11-23T13:00:07","guid":{"rendered":"https:\/\/66colorful.com\/blog\/?p=864"},"modified":"2026-11-23T13:00:07","modified_gmt":"2026-11-23T13:00:07","slug":"bg-color-tailwind-readable-text","status":"publish","type":"post","link":"https:\/\/66colorful.com\/blog\/bg-color-tailwind-readable-text\/","title":{"rendered":"Bg Color Tailwind: Choosing Background Utilities That Keep Text Readable"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The short answer for choosing a bg color Tailwind class: a <code>bg-*<\/code> utility picks the surface, but readability depends on the text color drawn on it, not on the shade&#8217;s name or number. A class like <code>bg-slate-100<\/code> is neither safe nor unsafe until you pair it with a real foreground color and test that pair.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This article walks through a short workflow: pick a candidate shade, pair it with a text color, test the pair against WCAG 2.2 AA, preview light and dark surfaces, then record the result in CSS variables. The Tailwind, MDN and W3C documentation referenced here was last consulted on November 21, 2026, and the example hex values are illustrative until you check the rendered pair yourself.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li class=\"\"><a href=\"#understand-what-a-bg-color-tailwind-utility-sets-1\">Understand what a bg color Tailwind utility sets<\/a><\/li><li class=\"\"><a href=\"#pick-a-candidate-shade-in-the-tailwind-colors-tool-2\">Pick a candidate shade in the Tailwind Colors tool<\/a><\/li><li class=\"\"><a href=\"#test-the-text-and-background-pair-before-you-ship-3\">Test the text and background pair before you ship<\/a><\/li><li class=\"\"><a href=\"#decide-when-a-bg-color-tailwind-value-should-be-a-custom-hex-4\">Decide when a bg color Tailwind value should be a custom hex<\/a><\/li><li class=\"\"><a href=\"#preview-light-and-dark-surfaces-with-both-classes-5\">Preview light and dark surfaces with both classes<\/a><\/li><li class=\"\"><a href=\"#record-the-tested-pair-in-css-variables-6\">Record the tested pair in CSS variables<\/a><\/li><li class=\"\"><a href=\"#frequently-asked-questions\">Frequently asked questions<\/a><\/li><li class=\"\"><a href=\"#next-steps\">Next steps<\/a><\/li><li class=\"\"><a href=\"#sources\">Sources and further reading<\/a><\/li><\/ul><\/nav><\/div>\n\n\n<div class=\"wp-block-image post_content_image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-1-821-1-3a5c1f8a13de89d1-1024x576.jpg\" alt=\"Layered pale paper cards on a desk representing background surfaces\" class=\"wp-image-867\" srcset=\"https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-1-821-1-3a5c1f8a13de89d1-1024x576.jpg 1024w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-1-821-1-3a5c1f8a13de89d1-300x169.jpg 300w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-1-821-1-3a5c1f8a13de89d1-768x432.jpg 768w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-1-821-1-3a5c1f8a13de89d1-800x450.jpg 800w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-1-821-1-3a5c1f8a13de89d1.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"understand-what-a-bg-color-tailwind-utility-sets-1\">Understand what a bg color Tailwind utility sets<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In Tailwind&#8217;s current documentation, a class such as <code>bg-slate-50<\/code> sets the CSS <code>background-color<\/code> property using the matching <code>--color-slate-50<\/code> theme variable. That makes Tailwind background-color utilities a thin layer over plain CSS. The property fills the box behind the content, and MDN notes that the color also sits behind any background image and shows through transparent parts of that image.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Utility<\/th><th>What it does<\/th><th>Use it for<\/th><\/tr><\/thead><tbody><tr><td><code>bg-white<\/code><\/td><td>Sets a white background color<\/td><td>A plain, neutral surface<\/td><\/tr><tr><td><code>bg-transparent<\/code><\/td><td>Sets a transparent background<\/td><td>Letting the parent surface show<\/td><\/tr><tr><td><code>bg-slate-50<\/code><\/td><td>Reads the <code>--color-slate-50<\/code> theme variable<\/td><td>A named default shade<\/td><\/tr><tr><td><code>bg-&#091;#123456&#093;<\/code><\/td><td>Arbitrary value for one element<\/td><td>A single exact color<\/td><\/tr><tr><td><code>bg-(--surface)<\/code><\/td><td>Reads a CSS custom property<\/td><td>A reused semantic token<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Every default color family has 11 numbered steps, from the lightest 50 to the darkest 950. A step is a starting point for a surface, not a contrast rating. Slate 50, written <a class=\"cf-color-chip cf-color-chip--link\" rel=\"nofollow\" href=\"https:\/\/66colorful.com\/color\/f8fafc\" title=\"View the #F8FAFC color page\" style=\"--cf-chip-color:#f8fafc;\"><span class=\"cf-color-chip__swatch\" aria-hidden=\"true\"><\/span><span class=\"cf-color-chip__label\">#F8FAFC<\/span><\/a>, is very pale, yet it can still fail with a mid-tone text color. If you plan to extend the defaults, the guide to <a href=\"https:\/\/66colorful.com\/blog\/tailwind-color-palette\/\" title=\"Tailwind Color Palette\">building a custom Tailwind color scale<\/a> explains how a scale is structured.<\/p>\n\n\n<div class=\"wp-block-image post_content_image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-2-821-2-bcc0421edbfd3e64-1024x1024.jpg\" alt=\"Hand holding a fan of graduated gray-blue swatches beside a laptop\" class=\"wp-image-869\" srcset=\"https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-2-821-2-bcc0421edbfd3e64-1024x1024.jpg 1024w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-2-821-2-bcc0421edbfd3e64-300x300.jpg 300w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-2-821-2-bcc0421edbfd3e64-150x150.jpg 150w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-2-821-2-bcc0421edbfd3e64-768x768.jpg 768w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-2-821-2-bcc0421edbfd3e64.jpg 1080w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"pick-a-candidate-shade-in-the-tailwind-colors-tool-2\">Pick a candidate shade in the Tailwind Colors tool<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start with a role rather than a color: page surface, card, subtle banner or strong button fill. Then use the <a href=\"https:\/\/66colorful.com\/tools\/tailwind-colors\" title=\"Tailwind CSS Colors Palette\">Tailwind Colors tool<\/a> to narrow the options. The steps below follow the controls on the page as it appeared in the site snapshot read on November 21, 2026.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Choose the version tab that matches your project: v4.3 OKLCH or v3.4 HEX. The page defines v4 values in OKLCH and shows HEX as the sRGB equivalent, and it marks swatches that look more vivid on wide-gamut screens.<\/li>\n\n\n\n<li>Search a family and shade, such as sky, 500 or rose-300, or browse the neutrals.<\/li>\n\n\n\n<li>Choose the class format and click a swatch to copy its class. Shift+click copies the alternate format.<\/li>\n\n\n\n<li>Turn on the option that shows WCAG text contrast on swatches as a quick screen, then confirm your final pair separately in the next step.<\/li>\n\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Page backgrounds and cards usually come from the light end (50 to 100) or the dark end (900 to 950), because body text sits on them. The neutral families such as slate, zinc and stone give quiet surfaces without a strong hue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The page also includes a Closest Tailwind Color Finder. It ranks default colors against a color you type, using CIEDE2000, which helps when a designer hands you an arbitrary hex. The nearest match is a visual approximation, not the same color, so treat it as a candidate and test it.<\/p>\n\n\n<div class=\"wp-block-image post_content_image\">\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6b06ffb26c30f&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6b06ffb26c30f\" class=\"aligncenter size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-3-821-3-375ca7a1e4f58db2-1024x768.jpg\" alt=\"Monitor with a pale card and a dark card beside each other on a desk\" class=\"wp-image-871\" srcset=\"https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-3-821-3-375ca7a1e4f58db2-1024x768.jpg 1024w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-3-821-3-375ca7a1e4f58db2-300x225.jpg 300w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-3-821-3-375ca7a1e4f58db2-768x576.jpg 768w, https:\/\/66colorful.com\/blog\/wp-content\/uploads\/2026\/11\/bg-color-tailwind-image-3-821-3-375ca7a1e4f58db2.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"test-the-text-and-background-pair-before-you-ship-3\">Test the text and background pair before you ship<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Contrast belongs to a pair, so enter the real foreground and background values into the <a href=\"https:\/\/66colorful.com\/tools\/contrast-checker\" title=\"Contrast Checker\">Contrast Checker<\/a>. For example, test <a class=\"cf-color-chip cf-color-chip--link\" rel=\"nofollow\" href=\"https:\/\/66colorful.com\/color\/0f172b\" title=\"View the #0F172B color page\" style=\"--cf-chip-color:#0f172b;\"><span class=\"cf-color-chip__swatch\" aria-hidden=\"true\"><\/span><span class=\"cf-color-chip__label\">#0F172B<\/span><\/a> text (slate 900) on a <a class=\"cf-color-chip cf-color-chip--link\" rel=\"nofollow\" href=\"https:\/\/66colorful.com\/color\/f8fafc\" title=\"View the #F8FAFC color page\" style=\"--cf-chip-color:#f8fafc;\"><span class=\"cf-color-chip__swatch\" aria-hidden=\"true\"><\/span><span class=\"cf-color-chip__label\">#F8FAFC<\/span><\/a> surface (slate 50). I am not quoting a ratio because the number that matters is the one you measure for your own pair, at your own font size and weight.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>What you are checking<\/th><th>WCAG 2.2 AA minimum<\/th><th>Criterion<\/th><\/tr><\/thead><tbody><tr><td>Normal text<\/td><td>4.5:1<\/td><td>1.4.3 Contrast (Minimum)<\/td><\/tr><tr><td>Large text (at least 18 point, or 14 point bold)<\/td><td>3:1<\/td><td>1.4.3 Contrast (Minimum)<\/td><\/tr><tr><td>Visual information required to identify controls and states<\/td><td>3:1<\/td><td>1.4.11 Non-text Contrast<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A text pair that passes only at 3:1 is not suitable for ordinary body copy. Test each state that changes the pair too, such as hover, selected and error fills, because each one creates a new foreground and background combination. If you wonder why a shade that looks light on a slider still fails, read <a href=\"https:\/\/66colorful.com\/blog\/hsl-lightness-vs-relative-luminance-for-text-contrast\/\" title=\"Hsl Lightness Vs Relative Luminance For Text Contrast\">why HSL lightness is not relative luminance<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"section-2-detail-1\">Where a two-color check stops<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A result for two solid colors does not automatically validate text over a translucent surface such as <code>bg-white\/50<\/code>, a gradient or a photo, because the effective color behind the text can vary. For how alpha composites, see <a href=\"https:\/\/66colorful.com\/blog\/color-page-hex-code-with-alpha-on-different-backgrounds\/\" title=\"Color Page Hex Code With Alpha On Different Backgrounds\">how alpha changes a HEX code over different backgrounds<\/a>. For photo surfaces, the article on <a href=\"https:\/\/66colorful.com\/blog\/glassmorphism-card-text-contrast-over-photo\/\" title=\"Glassmorphism Card Text Contrast Over Photo\">text contrast on a frosted card over a photo<\/a> shows what to inspect. Always look at the rendered result in context. A calculator result is a targeted color-pair check, not a conformance claim for the whole page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"decide-when-a-bg-color-tailwind-value-should-be-a-custom-hex-4\">Decide when a bg color Tailwind value should be a custom hex<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">My decision rule is simple. Prefer a named default shade when it meets the design need and the tested contrast target. Use a custom hex when an exact specified color cannot be represented adequately by any default shade.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>One-off exact color:<\/strong> use the arbitrary value syntax, such as <code>bg-&#091;#123456&#093;<\/code>. It keeps a single special case local.<\/li>\n\n\n\n<li><strong>Recurring color:<\/strong> give it a semantic token instead of scattering arbitrary values. In Tailwind v4, a <code>--color-*<\/code> variable in your theme creates named utilities.<\/li>\n\n\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"css\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">@theme {\n  --color-brand: #123456;\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With that theme entry, <code>bg-brand<\/code> becomes available. The hex is illustrative, so test the pair you actually use. If the brand color needs lighter and darker steps, the <a href=\"https:\/\/66colorful.com\/tools\/tailwind-scale-generator\" title=\"Tailwind Color Scale Generator\">Tailwind Color Scale Generator<\/a> builds a 50 to 950 scale from one HEX. Its swatches show contrast against white and black text only, so your real text color still needs the pair test above.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also record where each value came from. A v4 OKLCH value and a v3 HEX value from the same family should not be assumed to render identically. If you move values between formats, <a href=\"https:\/\/66colorful.com\/blog\/hex-to-oklch-and-back-css-colors\/\" title=\"Hex To Oklch And Back Css Colors\">converting between HEX and OKLCH in CSS<\/a> covers what to expect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"preview-light-and-dark-surfaces-with-both-classes-5\">Preview light and dark surfaces with both classes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Set the background and the text color together on the same element, so the pair travels as one unit:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;div class=&quot;bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-50&quot;&gt;\n  ...\n&lt;\/div&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In Tailwind&#8217;s documentation, the <code>dark:<\/code> variant follows <code>prefers-color-scheme<\/code> by default. You can configure it to follow a class or a data attribute instead, so match the strategy your site ships before you judge a preview. Then view both appearances and test each pair.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not assume that swapping step 50 for 900 produces a passing dark pair. Check <a class=\"cf-color-chip cf-color-chip--link\" rel=\"nofollow\" href=\"https:\/\/66colorful.com\/color\/f8fafc\" title=\"View the #F8FAFC color page\" style=\"--cf-chip-color:#f8fafc;\"><span class=\"cf-color-chip__swatch\" aria-hidden=\"true\"><\/span><span class=\"cf-color-chip__label\">#F8FAFC<\/span><\/a> text on <a class=\"cf-color-chip cf-color-chip--link\" rel=\"nofollow\" href=\"https:\/\/66colorful.com\/color\/0f172b\" title=\"View the #0F172B color page\" style=\"--cf-chip-color:#0f172b;\"><span class=\"cf-color-chip__swatch\" aria-hidden=\"true\"><\/span><span class=\"cf-color-chip__label\">#0F172B<\/span><\/a> in the Contrast Checker like any other pair. Also check states that alter the surface, such as a <code>hover:<\/code> fill, since a new background means a new test for the text on it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Links deserve a separate look on dark surfaces, because default and visited link colors are two more foreground values. The article on <a href=\"https:\/\/66colorful.com\/blog\/visited-link-colors-dark-mode-contrast\/\" title=\"Visited Link Colors Dark Mode Contrast\">visited link colors in dark mode<\/a> shows how to check both without losing the underline.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"record-the-tested-pair-in-css-variables-6\">Record the tested pair in CSS variables<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once a pair holds up in the contexts you tested, store it as tokens named for their role rather than their color. These hex values are illustrative:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"css\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">:root {\n  --surface: #f8fafc;\n  --on-surface: #0f172b;\n}\n\n@media (prefers-color-scheme: dark) {\n  :root {\n    --surface: #0f172b;\n    --on-surface: #f8fafc;\n  }\n}\n\n.card {\n  color: var(--on-surface);\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>bg-(--surface)<\/code> for the background and the CSS <code>color: var(--on-surface)<\/code> for the foreground. If your site toggles dark mode with a class or data attribute, replace the media query with the matching selector. To draft a themed set of variables, the <a href=\"https:\/\/66colorful.com\/tools\/css-variable-theme-generator\" title=\"Css Variable Theme Generator\">CSS Variable Theme Generator<\/a> is a browser tool that can help, and you should still test the resulting pairs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Next to the variables, keep a short note so the next person knows what was verified:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Field<\/th><th>What to write down<\/th><\/tr><\/thead><tbody><tr><td>Foreground<\/td><td>The text token, for example <code>--on-surface<\/code><\/td><\/tr><tr><td>Surface<\/td><td>The background token, for example <code>--surface<\/code><\/td><\/tr><tr><td>Theme<\/td><td>Light, dark or both<\/td><\/tr><tr><td>State<\/td><td>Default, hover, selected, error<\/td><\/tr><tr><td>Ratio<\/td><td>The value you measured, plus the date and tool<\/td><\/tr><tr><td>Palette source<\/td><td>Tailwind v4 OKLCH, v3 HEX or a custom value<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-1\">Is Tailwind background-color the same as the CSS property?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. A color utility such as bg-slate-50 sets the CSS background-color property, using the matching theme variable, here &#8211;color-slate-50. It is a shortcut to the same property MDN documents, so transparency and background images behave as they do in plain CSS.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-2\">Does a higher shade number guarantee readable text?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. The numbers run from 50 to 950 and describe a step in a scale, not a contrast rating. Readability depends on the text color placed on top, its size and weight, so test the actual pair.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-3\">What contrast ratio do I need for text on a Tailwind background?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Under WCAG 2.2 AA, normal text needs at least 4.5:1 and qualifying large text needs 3:1. Visual indicators required to identify controls and states have a separate 3:1 non-text requirement. A 3:1 text pair is not suitable for ordinary body copy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-4\">Can I trust a contrast result for bg-white\/50 or a gradient?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Not directly. A checker compares two solid colors, while a translucent surface, gradient or image changes the effective color behind the text from place to place. Inspect the rendered result in context, and treat the checker as a targeted aid.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-5\">When should I use an arbitrary hex like bg-[#123456]?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use it for a one-off exact color that no default shade represents adequately. If the same color appears repeatedly, turn it into a semantic token or a theme color so the value lives in one place.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-6\">Do Tailwind v3 HEX and v4 OKLCH palettes render identically?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Do not assume so. The 66Colorful Tailwind Colors page lets you switch between v4 OKLCH and v3.4 HEX values, and the two versions are not guaranteed to produce identical rendered colors. Record which source you used.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-7\">How do I test dark surfaces in Tailwind?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By default the dark: variant follows prefers-color-scheme, and it can be configured to follow a class or data attribute. Switch to the dark appearance using whichever strategy your site uses, then test each text and background pair, including hover and selected states.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps\">Next steps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Choosing a bg color Tailwind class gets easier when you treat it as half of a pair. Pick a candidate from the default families, test it with the real text color against the 4.5:1 and 3:1 targets that apply, preview light and dark appearances, and save the result as tokens with the ratio you measured. Use a named shade when it works, a custom hex when an exact color demands it, and a semantic variable once that color repeats. The Tailwind Colors tool and the Contrast Checker cover the first two steps in your browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Related tools &amp; resources on 66Colorful:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/66colorful.com\/tools\/tailwind-colors\">Tailwind Colors<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/66colorful.com\/tools\/contrast-checker\">Contrast Checker<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/66colorful.com\/tools\/tailwind-scale-generator\">Tailwind Scale Generator<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/66colorful.com\/tools\/css-variable-theme-generator\">Css Variable Theme Generator<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/66colorful.com\/blog\/tailwind-color-palette\/\">Tailwind Color Palette<\/a><\/li>\n\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"sources\">Sources and further reading<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.w3.org\/WAI\/WCAG22\/Understanding\/contrast-minimum.html\" target=\"_blank\" rel=\"noopener\">Understanding Success Criterion 1.4.3: Contrast (Minimum) | WAI | W3C<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/tailwindcss.com\/docs\/background-color\" target=\"_blank\" rel=\"noopener\">background-color &#8211; Backgrounds &#8211; Tailwind CSS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/tailwindcss.com\/docs\/colors\" target=\"_blank\" rel=\"noopener\">Colors &#8211; Core concepts &#8211; Tailwind CSS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/tailwindcss.com\/docs\/theme\" target=\"_blank\" rel=\"noopener\">Theme variables &#8211; Core concepts &#8211; Tailwind CSS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/Reference\/Properties\/background-color\" target=\"_blank\" rel=\"noopener\">background-color CSS property &#8211; CSS | MDN<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/tailwindcss.com\/docs\/dark-mode\" target=\"_blank\" rel=\"noopener\">Dark mode &#8211; Core concepts &#8211; Tailwind CSS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.w3.org\/WAI\/WCAG22\/Understanding\/non-text-contrast.html\" target=\"_blank\" rel=\"noopener\">Understanding Success Criterion 1.4.11: Non-text Contrast | WAI | W3C<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.w3.org\/TR\/2023\/REC-WCAG22-20231005\/\" target=\"_blank\" rel=\"noopener\">Web Content Accessibility Guidelines (WCAG) 2.2<\/a><\/li>\n\n\n<\/ul>\n\n\n","protected":false},"excerpt":{"rendered":"<p>Bg color Tailwind choices start with a utility, but readability depends on the text on top. Pick a shade, test the pair, and save it as a token.<\/p>\n","protected":false},"author":1,"featured_media":865,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[374,55,17,8,41,294,103],"class_list":["post-864","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-design","tag-background-colors","tag-css-variables","tag-dark-mode","tag-design-tokens","tag-tailwind-css","tag-text-contrast","tag-wcag-2-2"],"_links":{"self":[{"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/posts\/864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/comments?post=864"}],"version-history":[{"count":4,"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/posts\/864\/revisions"}],"predecessor-version":[{"id":872,"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/posts\/864\/revisions\/872"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/media\/865"}],"wp:attachment":[{"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/media?parent=864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/categories?post=864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/66colorful.com\/blog\/wp-json\/wp\/v2\/tags?post=864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}