Loading tutorials
flex, px-4, and bg-blue-500, and the idea of a component or template partial. Its goal is to help you tell real duplication from repetition that is harmless.3 min readflex, px-4, and bg-blue-500. It also assumes you have used a loop or a partial in a template language or a component framework. Not every repeated class list needs a new abstraction. Sometimes the repetition exists only in the file3 min readpx-4 and bg-blue-600, and the basics of a component framework such as React. It covers the main way to reuse Tailwind styles: move repeated markup and classes into one component.2 min readButton component from the previous chapter.2 min readpx-4 and bg-blue-600, and the idea of a component or template partial. It covers the @apply directive: what it does, how to write a class with it, and where it stops being useful.2 min read@apply in the previous chapter. Here you will see where component classes should live and why that placement matters.2 min read@apply directive and @layer components from the previous chapters, and that you have used variants such as hover: and md: in markup. Here you will see how variants behave when you move them into CSS.2 min read@apply works in a global stylesheet, that you have used Tailwind utilities, and that you have written a component in Vue, Svelte, or a similar framework. It covers why @apply can fail in a component's own stylesheet and how to fix that in Tailwind CSS v4.3 min read@apply directive, and the @layer components pattern from earlier chapters. It also assumes you know what a variant such as hover: or md: does.3 min read@layer components pattern, and basic component-based UI. It covers where @apply causes trouble and how to avoid it.3 min read