Loading tutorials
@theme, you need a firm picture of how those variables behave in the browser. This chapter covers the parts of custom properti5 min readvar(). It also assumes you have used Tailwind utility classes in HTML and know Tailwind is imported from a CSS file. You don't need to have used @theme yet. The next chapters cover it in detail.5 min readvar(). It also assumes you have used Tailwind utility classes in HTML and know how to import Tailwind into a CSS file with @import "tailwindcss";.4 min read@import "tailwindcss";. The previous chapter showed that @theme turns variables into design tokens. Here you will learn the rule that decides which utiliti4 min read@theme block to the CSS that Tailwind writes. It assumes you know basic CSS custom properties and var(), and that you have used Tailwind utility classes. It also assumes you have a Tailwind v4 project that imports tailwindcss in a CSS file. Earl5 min read@theme directive, that variable names carry a namespace prefix such as --color- or --font-, and that Tailwind v4 generates utilities from those variables. You should also know how to put @import "tailwindcss"; at the top of your CSS file.4 min read@theme defines tokens and how namespaces map variables to utilities. It covers the one variable that drives Tailwind's whole spacing scale, how to change it, and how to add named spacing values next to it.4 min readvar(). It also assumes you can write Tailwind utility classes and that your CSS file starts with @import "tailwindcss";. By the end you should be able to decide, for any variable, whether it belongs in @theme or in :root.5 min readvar(), you have used Tailwind utility classes, and you know how to import Tailwind with @import "tailwindcss";. It also assumes you have defined tokens with @theme, as in the earlier chapters.4 min read@theme block, know that variable names in a namespace such as --color-* produce utilities, and have Tailwind v4 imported with @import "tailwindcss";. Here you will apply the same idea to animations. A variable in the --animate-* namespace becomes an4 min read@theme defines design tokens, how namespaces such as --color-* generate utilities, and how plain CSS custom properties and var() work. It covers one option of the directive, inline. The option matters when a theme variable points at another variable instead 5 min read@theme block, know how namespaces such as --color-* create utilities, and have used var() in plain CSS. It covers which theme variables Tailwind v4 writes into your compiled CSS, and how @theme static changes that.5 min read@theme turns namespaced variables into utilities, how :root variables differ from theme variables, and what @theme inline does at a basic level. Here you combine them to build a theme that changes while the page is open, with dark mode as the main case.4 min read@theme block, know how namespaces such as --color-* and --font-* map to utilities, and understand @theme inline and @theme static. It also assumes you have a working Tailwind CSS v4 setup in at least one project.4 min readtailwind.config.js, to the CSS-first setup of v4. It assumes you have read the earlier chapters on @theme, namespaces, extending and resetting the theme, and @theme inline. You should also know what a theme.extend block 4 min read