Skip to content

Using custom utilities inside custom utilities #4061

Answered by olets
simonhammerholt asked this question in Help
Discussion options

You must be logged in to vote

You can apply custom utilities and components in your custom utilities and components.

A minimal example of applying a custom utility:

@layer utilities {
  .my-utility {
    @apply text-red-400;
  }

  .my-other-utility {
    @apply my-utility;
  }
}

A minimal example of applying utilities defined in a stylesheet or in the config: https://play.tailwindcss.com/kW7DMucX1N

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@simonhammerholt
Comment options

Answer selected by simonhammerholt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants