Pular para o conteúdo
Skillpedia
Sites e telas (frontend)29 mil · #9366

tailwind-v4

O que ela faz

Esta skill é um guia para escrever código do Tailwind CSS versão 4 da forma correta. Ela aponta padrões antigos da versão 3 que não devem aparecer em código novo.

Quando usar

  • ✓Quando você está escrevendo ou alterando estilos Tailwind em um projeto.
  • ✓Quando você quer migrar código antigo do Tailwind versão 3 para a versão 4.
  • ✓Quando você quer configurar cores de tema personalizadas no novo estilo de configuração.

Link da skill

https://github.com/mastra-ai/mastra/blob/main/.claude/skills/tailwind-v4/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/mastra-ai/mastra/blob/main/.claude/skills/tailwind-v4/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Atualize os estilos deste componente para a sintaxe do Tailwind versão 4 e remova os padrões antigos da versão 3.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente usa a configuração baseada em CSS do Tailwind versão 4, em vez de um arquivo de configuração em JavaScript, e confere se os utilitários existem na versão que o projeto usa antes de empregá-los.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Tailwind CSS v4

How to write idiomatic Tailwind v4 and spot v3-era syntax that still compiles but should not appear in new code.

Version and sources

Check the pinned version before using recent utilities: the playground packages pin tailwindcss in their package.json (4.3.3 at the time of writing, including v4.3 utilities like scrollbar-*, zoom-*, and tab-*). When unsure whether a utility, variant, or directive exists in the pinned version, verify against the docs instead of guessing:

CSS-first configuration

Tailwind v4 is configured in CSS, not JavaScript.

Use Never use (v3-era)
@import 'tailwindcss' @tailwind base/components/utilities
@theme { --color-x: ...; } for tokens that should generate utilities tailwind.config.ts for new work
@utility name { ... } for custom utilities (works with variants) @layer utilities { .name { ... } }
@custom-variant dark (&:is(.dark *)) JS plugins / addVariant
@source "path" / @source inline("...") for extra sources / safelisting content array / safelist config
@variant dark { ... } to apply a Tailwind variant inside custom CSS duplicating media queries / selectors
@reference "app.css" for @apply in scoped styles (Vue, CSS Modules) duplicating stylesheet imports
var(--color-x) in CSS, getComputedStyle in JS theme() function, resolveConfig
@config "…" / @plugin "…" only for existing JS-config integrations adding new JS configs or plugins

@theme variables are API: each one emits a native CSS variable AND generates utilities (--color-* → bg-*/text-*/border-*/..., --text-* → text-*, --shadow-* → shadow-*, --animate-* → animate-*, --breakpoint-* → responsive variants). A plain :root { --x: ...; } variable generates nothing — use it for runtime-only values. When a token's value references another variable (--color-x: var(--y)), declare it in @theme inline so the utility resolves the reference at the declaration site. In custom CSS, --alpha(var(--color-x) / 50%) and --spacing(4) replace v3 theme() math.

v3 → v4 renames

Bare names shifted one step down the scale, so the v3 spelling silently renders smaller or lighter:

v3 v4
shadow-sm / shadow shadow-xs / shadow-sm
drop-shadow-sm / drop-shadow drop-shadow-xs / drop-shadow-sm
blur-sm / blur blur-xs / blur-sm
rounded-sm / rounded rounded-xs / rounded-sm
outline-none outline-hidden (a11y-safe); outline-none now truly removes it
ring (3px) ring-3; the default ring is now 1px currentColor
bg-opacity-50, text-opacity-* opacity modifier: bg-black/50, text-white/50
bg-gradient-to-r bg-linear-to-r (plus new bg-conic-*, bg-radial-*)
!bg-red-500 (prefix) bg-red-500! (suffix)
flex-shrink-* / flex-grow-* shrink-* / grow-*
bg-[--var] bg-(--var); brackets now require bg-[var(--var)]
grid-cols-[a,b] (commas) underscores: grid-cols-[max-content_auto]

Prefer generated utilities over arbitrary values

The spacing scale is infinite — every number compiles via calc(var(--spacing) * n) — so mo

Perguntas frequentes

O projeto ainda precisa de um arquivo de configuração do Tailwind?

Para trabalho novo, a configuração é escrita em CSS, em vez de em um arquivo JavaScript.

Como ele sabe quais recursos estão disponíveis?

Ele verifica a versão do Tailwind fixada no projeto e consulta a documentação oficial quando tem dúvida.

A sintaxe antiga está quebrada?

Grande parte dela ainda compila, mas a skill orienta o código novo a se afastar dela.

Detalhes

Descrição original do autor

Tailwind CSS v4 usage guide and v3-to-v4 differences. This skill should be used when writing, reviewing, or refactoring any Tailwind CSS code in this repo. Triggers on tasks involving Tailwind classes, @theme blocks, CSS-first configuration, or cleanup of v3-era syntax.

repo: mastra-ai/mastra

Popularidade

Estrelas no GitHub
29 mil
Posição no ranking
#9366
Licença
—
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas