Module content

Module content 

Source
Expand description

Utilities for controlling the content of the before and after pseudo-elements.

Class Properties
content-nonecontent: none;

§Note

The content utility must be used in combination with either the before or the after variant to work.

§Arbitrary values

Any property is allowed as arbitrary value. It’s the only way of setting the content. For example, before:content-['Hello_world!'] or after:content-[url(foobar.png)].

Because the default scanner splits by some special characters, you must use the following escape codes in arbitrary values:

  • " for "
  • ' for '
  • ( for (
  • ) for )
  • [ for [
  • \ for \
  • ] for ]
  • _ for _ (because by default _ is replaced by a space in arbitrary values, so _ prevents this behavior)
  • ` for `

Tailwind reference