Skip to content

Outline Style

Use outline style utilities to control the stroke pattern of an element’s outline. Dashed, dotted, and double strokes are painted by DashedBorderPainter (the same painter used by border-dashed).

Use outline-solid, outline-dashed, outline-dotted, or outline-double to set the outline style:

Style('outline-2 outline-offset-2 outline-solid ...', child: Text('Button A'))
Style('outline-2 outline-offset-2 outline-dashed ...', child: Text('Button B'))
Style('outline-2 outline-offset-2 outline-dotted ...', child: Text('Button C'))
Style('outline-3 outline-offset-2 outline-double ...', child: Text('Button D'))

Use outline-hidden to hide the default browser outline while keeping it visible in forced-colors mode. In Flutter this sets a transparent solid outline (outline: 2px solid transparent; outline-offset: 2px):

Style('focus:border-indigo-600 focus:outline-hidden ...')

Use outline-none to completely remove outlines. Combine with focus-within:outline-* to style a container when a child is focused:

Style('focus-within:outline-2 focus-within:outline-indigo-600 ...', children: [
Style('outline-none ...'),
Style('...', child: Text('Post')),
])
ClassDescription
outline-solidSolid outline (explicit; default when width is set)
outline-dashedDashed outline (painted by DashedBorderPainter)
outline-dottedDotted outline with round caps
outline-doubleTwo parallel solid lines with a gap
outline-noneRemoves outline (outline-style: none)
outline-hiddenTransparent 2px solid outline with 2px offset