Movatterモバイル変換


[0]ホーム

URL:


  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(97.1% 0.013 17.38) */
outline-red-100
outline-color: var(--color-red-100);/* oklch(93.6% 0.032 17.717) */
outline-red-200
outline-color: var(--color-red-200);/* oklch(88.5% 0.062 18.334) */
outline-red-300
outline-color: var(--color-red-300);/* oklch(80.8% 0.114 19.571) */
outline-red-400
outline-color: var(--color-red-400);/* oklch(70.4% 0.191 22.216) */

Examples

Basic example

Use utilities likeoutline-rose-500 andoutline-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-2outline-blue-500 ...">Button A</button><button class="outline-2 outline-offset-2outline-cyan-500 ...">Button B</button><button class="outline-2 outline-offset-2outline-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 theoutline-[<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 theoutline-(<custom-property>) syntax:

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

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

Responsive design

Prefix anoutline-color utility with a breakpoint variant likemd: to only apply the utility at medium screen sizes and above:

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

Learn more about using variants in thevariants documentation.

Customizing your theme

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

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

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

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

Learn more about customizing your theme in thetheme documentation.

Copyright © 2025 Tailwind Labs Inc.·Trademark Policy

[8]ページ先頭

©2009-2025 Movatter.jp