Tailwind CSS - Outline Color



Tailwind CSS Outline Color is a collection of predefined classes used to apply various colors to the outlines of elements.

Tailwind CSS Outline Color Classes

Below is a list of Tailwind CSS Outline Color classes and properties that allow you to customize the color of outlines on elements.

Class CSS Properties
outline-inherit outline-color: inherit;
outline-current outline-color: currentColor;
outline-transparent outline-color: transparent;
outline-black outline-color: #000;
outline-white outline-color: #fff;
outline-slate-50 outline-color: #f8fafc;
outline-slate-100 outline-color: #f1f5f9;
outline-slate-200 outline-color: #e2e8f0;
outline-slate-300 outline-color: #cbd5e1;
outline-slate-400 outline-color: #94a3b8;
outline-slate-500 outline-color: #64748b;
outline-slate-600 outline-color: #475569;
outline-slate-700 outline-color: #334155;
outline-slate-800 outline-color: #1e293b;
outline-slate-900 outline-color: #0f172a;
outline-slate-950 outline-color: #020617;
outline-gray-50 outline-color: #f9fafb;
outline-gray-100 outline-color: #f3f4f6;
outline-gray-200 outline-color: #e5e7eb;
outline-gray-300 outline-color: #d1d5db;
outline-gray-400 outline-color: #9ca3af;
outline-gray-500 outline-color: #6b7280;
outline-gray-600 outline-color: #4b5563;
outline-gray-700 outline-color: #374151;
outline-gray-800 outline-color: #1f2937;
outline-gray-900 outline-color: #111827;
outline-gray-950 outline-color: #030712;
outline-zinc-50 outline-color: #fafafa;
outline-zinc-100 outline-color: #f4f4f5;
outline-zinc-200 outline-color: #e4e4e7;
outline-zinc-300 outline-color: #d4d4d8;
outline-zinc-400 outline-color: #a1a1aa;
outline-zinc-500 outline-color: #71717a;
outline-zinc-600 outline-color: #52525b;
outline-zinc-700 outline-color: #3f3f46;
outline-zinc-800 outline-color: #27272a;
outline-zinc-900 outline-color: #18181b;
outline-zinc-950 outline-color: #09090b;
outline-neutral-50 outline-color: #fafafa;
outline-neutral-100 outline-color: #f5f5f5;
outline-neutral-200 outline-color: #e5e5e5;
outline-neutral-300 outline-color: #d4d4d4;
outline-neutral-400 outline-color: #a3a3a3;
outline-neutral-500 outline-color: #737373;
outline-neutral-600 outline-color: #525252;
outline-neutral-700 outline-color: #404040;
outline-neutral-800 outline-color: #262626;
outline-neutral-900 outline-color: #171717;
outline-neutral-950 outline-color: #0a0a0a;
outline-stone-50 outline-color: #fafaf9;
outline-stone-100 outline-color: #f5f5f4;
outline-stone-200 outline-color: #e7e5e4;
outline-stone-300 outline-color: #d6d3d1;
outline-stone-400 outline-color: #a8a29e;
outline-stone-500 outline-color: #78716c;
outline-stone-600 outline-color: #57534e;
outline-stone-700 outline-color: #44403c;
outline-stone-800 outline-color: #292524;
outline-stone-900 outline-color: #1c1917;
outline-stone-950 outline-color: #0c0a09;
outline-red-50 outline-color: #fef2f2;
outline-red-100 outline-color: #fee2e2;
outline-red-200 outline-color: #fecaca;
outline-red-300 outline-color: #fca5a5;
outline-red-400 outline-color: #f87171;
outline-red-500 outline-color: #ef4444;
outline-red-600 outline-color: #dc2626;
outline-red-700 outline-color: #b91c1c;
outline-red-800 outline-color: #991b1b;
outline-red-900 outline-color: #7f1d1d;
outline-red-950 outline-color: #450a0a;
outline-orange-50 outline-color: #fff7ed;
outline-orange-100 outline-color: #ffedd5;
outline-orange-200 outline-color: #fed7aa;
outline-orange-300 outline-color: #fdba74;
outline-orange-400 outline-color: #fb923c;
outline-orange-500 outline-color: #f97316;
outline-orange-600 outline-color: #ea580c;
outline-orange-700 outline-color: #c2410c;
outline-orange-800 outline-color: #9a3412;
outline-orange-900 outline-color: #7c2d12;
outline-orange-950 outline-color: #431407;
outline-amber-50 outline-color: #fffbeb;
outline-amber-100 outline-color: #fef3c7;
outline-amber-200 outline-color: #fde68a;
outline-amber-300 outline-color: #fcd34d;
outline-amber-400 outline-color: #fbbf24;
outline-amber-500 outline-color: #f59e0b;
outline-amber-600 outline-color: #d97706;
outline-amber-700 outline-color: #b45309;
outline-amber-800 outline-color: #92400e;
outline-amber-900 outline-color: #78350f;
outline-amber-950 outline-color: #451a03;
outline-yellow-50 outline-color: #fefce8;
outline-yellow-100 outline-color: #fef9c3;
outline-yellow-200 outline-color: #fef08a;
outline-yellow-300 outline-color: #fde047;
outline-yellow-400 outline-color: #facc15;
outline-yellow-500 outline-color: #eab308;
outline-yellow-600 outline-color: #ca8a04;
outline-yellow-700 outline-color: #a16207;
outline-yellow-800 outline-color: #854d0e;
outline-yellow-900 outline-color: #713f12;
outline-yellow-950 outline-color: #422006;
outline-lime-50 outline-color: #f7fee7;
outline-lime-100 outline-color: #ecfccb;
outline-lime-200 outline-color: #d9f99d;
outline-lime-300 outline-color: #bef264;
outline-lime-400 outline-color: #a3e635;
outline-lime-500 outline-color: #84cc16;
outline-lime-600 outline-color: #65a30d;
outline-lime-700 outline-color: #4d7c0f;
outline-lime-800 outline-color: #3f6212;
outline-lime-900 outline-color: #365314;
outline-lime-950 outline-color: #1a2e05;
outline-green-50 outline-color: #f0fdf4;
outline-green-100 outline-color: #dcfce7;
outline-green-200 outline-color: #bbf7d0;
outline-green-300 outline-color: #86efac;
outline-green-400 outline-color: #4ade80;
outline-green-500 outline-color: #22c55e;
outline-green-600 outline-color: #16a34a;
outline-green-700 outline-color: #15803d;
outline-green-800 outline-color: #166534;
outline-green-900 outline-color: #14532d;
outline-green-950 outline-color: #052e16;
outline-emerald-50 outline-color: #ecfdf5;
outline-emerald-100 outline-color: #d1fae5;
outline-emerald-200 outline-color: #a7f3d0;
outline-emerald-300 outline-color: #6ee7b7;
outline-emerald-400 outline-color: #34d399;
outline-emerald-500 outline-color: #10b981;
outline-emerald-600 outline-color: #059669;
outline-emerald-700 outline-color: #047857;
outline-emerald-800 outline-color: #065f46;
outline-emerald-900 outline-color: #064e3b;
outline-emerald-950 outline-color: #022c22;
outline-teal-50 outline-color: #f0fdfa;
outline-teal-100 outline-color: #ccfbf1;
outline-teal-200 outline-color: #99f6e4;
outline-teal-300 outline-color: #5eead4;
outline-teal-400 outline-color: #2dd4bf;
outline-teal-500 outline-color: #14b8a6;
outline-teal-600 outline-color: #0d9488;
outline-teal-700 outline-color: #0f766e;
outline-teal-800 outline-color: #115e59;
outline-teal-900 outline-color: #134e4a;
outline-teal-950 outline-color: #042f2e;
outline-cyan-50 outline-color: #ecfeff;
outline-cyan-100 outline-color: #cffafe;
outline-cyan-200 outline-color: #a5f3fc;
outline-cyan-300 outline-color: #67e8f9;
outline-cyan-400 outline-color: #22d3ee;
outline-cyan-500 outline-color: #06b6d4;
outline-cyan-600 outline-color: #0891b2;
outline-cyan-700 outline-color: #0e7490;
outline-cyan-800 outline-color: #155e75;
outline-cyan-900 outline-color: #164e63;
outline-cyan-950 outline-color: #083344;
outline-sky-50 outline-color: #f0f9ff;
outline-sky-100 outline-color: #e0f2fe;
outline-sky-200 outline-color: #bae6fd;
outline-sky-300 outline-color: #7dd3fc;
outline-sky-400 outline-color: #38bdf8;
outline-sky-500 outline-color: #0ea5e9;
outline-sky-600 outline-color: #0284c7;
outline-sky-700 outline-color: #0369a1;
outline-sky-800 outline-color: #075985;
outline-sky-900 outline-color: #0c4a6e;
outline-sky-950 outline-color: #082f49;
outline-blue-50 outline-color: #eff6ff;
outline-blue-100 outline-color: #dbeafe;
outline-blue-200 outline-color: #bfdbfe;
outline-blue-300 outline-color: #93c5fd;
outline-blue-400 outline-color: #60a5fa;
outline-blue-500 outline-color: #3b82f6;
outline-blue-600 outline-color: #2563eb;
outline-blue-700 outline-color: #1d4ed8;
outline-blue-800 outline-color: #1e40af;
outline-blue-900 outline-color: #1e3a8a;
outline-blue-950 outline-color: #172554;
outline-indigo-50 outline-color: #eef2ff;
outline-indigo-100 outline-color: #e0e7ff;
outline-indigo-200 outline-color: #c7d2fe;
outline-indigo-300 outline-color: #a5b4fc;
outline-indigo-400 outline-color: #818cf8;
outline-indigo-500 outline-color: #6366f1;
outline-indigo-600 outline-color: #4f46e5;
outline-indigo-700 outline-color: #4338ca;
outline-indigo-800 outline-color: #3730a3;
outline-indigo-900 outline-color: #312e81;
outline-indigo-950 outline-color: #1e1b4b;
outline-violet-50 outline-color: #f5f3ff;
outline-violet-100 outline-color: #ede9fe;
outline-violet-200 outline-color: #ddd6fe;
outline-violet-300 outline-color: #c4b5fd;
outline-violet-400 outline-color: #a78bfa;
outline-violet-500 outline-color: #8b5cf6;
outline-violet-600 outline-color: #7c3aed;
outline-violet-700 outline-color: #6d28d9;
outline-violet-800 outline-color: #5b21b6;
outline-violet-900 outline-color: #4c1d95;
outline-violet-950 outline-color: #2e1065;
outline-purple-50 outline-color: #faf5ff;
outline-purple-100 outline-color: #f3e8ff;
outline-purple-200 outline-color: #e9d5ff;
outline-purple-300 outline-color: #d8b4fe;
outline-purple-400 outline-color: #c084fc;
outline-purple-500 outline-color: #a855f7;
outline-purple-600 outline-color: #9333ea;
outline-purple-700 outline-color: #7e22ce;
outline-purple-800 outline-color: #6b21a8;
outline-purple-900 outline-color: #581c87;
outline-purple-950 outline-color: #3b0764;
outline-fuchsia-50 outline-color: #fdf4ff;
outline-fuchsia-100 outline-color: #fae8ff;
outline-fuchsia-200 outline-color: #f5d0fe;
outline-fuchsia-300 outline-color: #f0abfc;
outline-fuchsia-400 outline-color: #e879f9;
outline-fuchsia-500 outline-color: #d946ef;
outline-fuchsia-600 outline-color: #c026d3;
outline-fuchsia-700 outline-color: #a21caf;
outline-fuchsia-800 outline-color: #86198f;
outline-fuchsia-900 outline-color: #701a75;
outline-fuchsia-950 outline-color: #4a044e;
outline-pink-50 outline-color: #fdf2f8;
outline-pink-100 outline-color: #fce7f3;
outline-pink-200 outline-color: #fbcfe8;
outline-pink-300 outline-color: #f9a8d4;
outline-pink-400 outline-color: #f472b6;
outline-pink-500 outline-color: #ec4899;
outline-pink-600 outline-color: #db2777;
outline-pink-700 outline-color: #be185d;
outline-pink-800 outline-color: #9d174d;
outline-pink-900 outline-color: #831843;
outline-pink-950 outline-color: #500724;
outline-rose-50 outline-color: #fff1f2;
outline-rose-100 outline-color: #ffe4e6;
outline-rose-200 outline-color: #fecdd3;
outline-rose-300 outline-color: #fda4af;
outline-rose-400 outline-color: #fb7185;
outline-rose-500 outline-color: #f43f5e;
outline-rose-600 outline-color: #e11d48;
outline-rose-700 outline-color: #be123c;
outline-rose-800 outline-color: #9f1239;
outline-rose-900 outline-color: #881337;
outline-rose-950 outline-color: #4c0519;

Functionality of Tailwind CSS Outline Color Classes

  • outline-inherit: Sets the outline color to inherit from the parent element.
  • outline-current: Sets the outline color to the current color of the element.
  • outline-transparent: Makes the outline color transparent.
  • outline-black: Sets the outline color to black.
  • outline-white: Sets the outline color to white.
  • outline-slate-*: Sets the outline color to various shades of slate.
  • outline-gray-*: Sets the outline color to various shades of gray.
  • outline-zinc-*: Sets the outline color to various shades of zinc.
  • outline-neutral-*: Sets the outline color to various neutral shades.
  • outline-stone-*: Sets the outline color to various shades of stone.
  • outline-red-*: Sets the outline color to various shades of red.
  • outline-orange-*: Sets the outline color to various shades of orange.
  • outline-amber-*: Sets the outline color to various shades of amber.
  • outline-yellow-*: Sets the outline color to various shades of yellow.
  • outline-lime-*: Sets the outline color to various shades of lime.
  • outline-green-*: Sets the outline color to various shades of green.
  • outline-emerald-*: Sets the outline color to various shades of emerald.
  • outline-teal-*: Sets the outline color to various shades of teal.
  • outline-cyan-*: Sets the outline color to various shades of cyan.
  • outline-sky-*: Sets the outline color to various shades of sky.
  • outline-blue-*: Sets the outline color to various shades of blue.
  • outline-indigo-*: Sets the outline color to various shades of indigo.
  • outline-violet-*: Sets the outline color to various shades of violet.
  • outline-purple-*: Sets the outline color to various shades of purple.
  • outline-fuchsia-*: Sets the outline color to various shades of fuchsia.
  • outline-pink-*: Sets the outline color to various shades of pink.
  • outline-rose-*: Sets the outline color to various shades of rose.

Note: In 'outline-color-*', the '*' can be replaced with values from 50 to 950, with 50 representing the lightest shade and 950 the darkest shade.

Tailwind CSS Outline Color Class Examples

Below are examples of Tailwind CSS Outline Color classes that show how to apply different colors to text outlines. Each example uses a specific class to create various visual effects.

Setting Outline Color

Tailwind CSS's outline-color-* utility classes allow you to easily customize outlines by applying different colors. Each class combines a color identifier (e.g., 'red', 'blue', etc.) with a numeric value (e.g., '300', '400', '500') to indicate the shade intensity from light to dark.

This example shows how these classes improve the appearance of elements by applying different color outlines to elements.

Example

  
<!DOCTYPE html>
<html lang="en">
<head> 
    <script src="https://cdn.tailwindcss.com"></script>
</head>

<body class="p-4">
    <h2 class="text-2xl font-bold mb-6">
        Tailwind CSS Outline Color
    </h2>
    <div class="space-y-4"> 
        <p class="border border-black outline 
            outline-blue-500 outline-2 outline-offset-2">
            Blue outline. Swap with <strong>outline-color-*</strong>.
        </p>
        <p class="border border-black outline outline-red-500
            outline-2 outline-offset-2">
            Red outline. Swap with <strong>outline-color-*</strong>.
        </p>
        <p class="border border-black outline outline-green-500 
            outline-2 outline-offset-2">
            Green outline. Swap with <strong>outline-color-*</strong>.
        </p>
        <p class="border border-black outline outline-yellow-500 
            outline-2 outline-offset-2">
            Yellow outline. Swap with <strong>outline-color-*</strong>.
        </p>
        <p class="border border-black outline outline-purple-500 
            outline-2 outline-offset-2">
            Purple outline. Swap with <strong>outline-color-*</strong>.
        </p>
    </div>
</body>

</html>

Setting Outline Color and Different Opacities

The example shows how to use Tailwind CSS Outline classes to apply different shades of red with different opacities to paragraph elements. Try out different shades by using the outline-color-* classes to see other color options.

Example

<!DOCTYPE html>
<html lang="en">
<head> 
    <script src="https://cdn.tailwindcss.com"></script>
</head>

<body class="p-4">
    <h2 class="text-2xl font-bold mb-4">
        Tailwind CSS Outline Color
    </h2>
    <h3 class="underline font-bold mb-3">
        Changing the opacity with Red Outline Color:
    </h3>
    <div class="space-y-4"> 
        <p class="border border-black outline outline-red-900 
            outline-4 outline-offset-2">
            Dark red outline. Swap with <strong>outline-color-*</strong>.
        </p>
        <p class="border border-black outline outline-red-700 
            outline-4 outline-offset-2">
            Medium red outline. Swap with <strong>outline-color-*</strong>.
        </p>
        <p class="border border-black outline outline-red-500 
            outline-4 outline-offset-2">
            Light red outline. Swap with <strong>outline-color-*</strong>.
        </p>
        <p class="border border-black outline outline-red-300 
            outline-4 outline-offset-2">
            Very light red outline. Swap with <strong>outline-color-*</strong>.
        </p>
        <p class="border border-black outline outline-red-100 
            outline-4 outline-offset-2">
            Pale red outline. Swap with <strong>outline-color-*</strong>.
        </p>
    </div>
</body>

</html>
Advertisements