1. Borders
  2. outline-color

Borders

outline-color

Utilities for controlling the color of an element's outline.

ClassStyles
outline-inherit
outline-color: inherit;
outline-current
outline-color: currentColor;
outline-transparent
outline-color: transparent;
outline-black
outline-color: var(--color-black); /* #000 */
outline-white
outline-color: var(--color-white); /* #fff */
outline-red-50
outline-color: var(--color-red-50); /* oklch(0.971 0.013 17.38) */
outline-red-100
outline-color: var(--color-red-100); /* oklch(0.936 0.032 17.717) */
outline-red-200
outline-color: var(--color-red-200); /* oklch(0.885 0.062 18.334) */
outline-red-300
outline-color: var(--color-red-300); /* oklch(0.808 0.114 19.571) */
outline-red-400
outline-color: var(--color-red-400); /* oklch(0.704 0.191 22.216) */

Examples

Basic example

Use utilities like outline-rose-500 and outline-lime-100 to control the color of an element's outline:

outline-blue-500

outline-cyan-500

outline-pink-500

<button class="outline-2 outline-offset-2 outline-blue-500 ...">Button A</button><button class="outline-2 outline-offset-2 outline-cyan-500 ...">Button B</button><button class="outline-2 outline-offset-2 outline-pink-500 ...">Button C</button>

Changing the opacity

Use the color opacity modifier to control the opacity of an element's outline color:

outline-blue-500/100

outline-blue-500/75

outline-blue-500/50

<button class="outline-2 outline-blue-500/100 ...">Button A</button><button class="outline-2 outline-blue-500/75 ...">Button B</button><button class="outline-2 outline-blue-500/50 ...">Button C</button>

Using a custom value

Use the outline-[<value>] syntax to set the outline color based on a completely custom value:

<div class="outline-[#243c5a] ...">  <!-- ... --></div>

For CSS variables, you can also use the outline-(<custom-property>) syntax:

<div class="outline-(--my-color) ...">  <!-- ... --></div>

This is just a shorthand for outline-[var(<custom-property>)] that adds the var() function for you automatically.

Responsive design

Prefix an outline-color utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<div class="outline md:outline-blue-400 ...">  <!-- ... --></div>

Learn more about using variants in the variants documentation.

Customizing your theme

Use the --color-* theme variables to customize the color utilities in your project:

@theme {  --color-regal-blue: #243c5a; }

Now the outline-regal-blue utility can be used in your markup:

<div class="outline-regal-blue">  <!-- ... --></div>

Learn more about customizing your theme in the theme documentation.

Copyright © 2025 Tailwind Labs Inc.·Trademark Policy