Skillpedia
المواقع والواجهات (frontend)29k · #9366

tailwind-v4

ما الذي تفعله

هذه المهارة دليل لكتابة شيفرة Tailwind CSS الإصدار 4 بشكل صحيح. تنبّه إلى أنماط الإصدار 3 القديمة التي لا ينبغي أن تظهر في الشيفرة الجديدة.

متى تستخدمها

  • ✓عندما تكتب أو تغيّر تنسيقات Tailwind في مشروع.
  • ✓عندما تريد نقل شيفرة Tailwind الإصدار 3 القديمة إلى الإصدار 4.
  • ✓عندما تريد ضبط ألوان سمة مخصصة بأسلوب الإعداد الجديد.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/mastra-ai/mastra/blob/main/.claude/skills/tailwind-v4/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“حدّث التنسيقات في هذا المكون لتستخدم صيغة Tailwind الإصدار 4، واحذف أنماط الإصدار 3 القديمة.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يستخدم وكيلك الإعداد المبني على CSS في Tailwind الإصدار 4 بدل ملف إعداد JavaScript، ويتحقق من وجود الأدوات في الإصدار الذي يستخدمه المشروع قبل استخدامها.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من 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

الأسئلة الشائعة

هل ما زال المشروع يحتاج إلى ملف إعداد tailwind؟

في العمل الجديد يُكتب الإعداد بلغة CSS بدل ملف JavaScript.

كيف يعرف الميزات المتاحة؟

يتحقق من إصدار Tailwind الذي يثبّته المشروع، ويرجع إلى الوثائق الرسمية عند الشك.

هل الصيغة القديمة معطوبة؟

كثير منها ما زال يترجم، لكن المهارة توجّه الشيفرة الجديدة بعيدًا عنها.

التفاصيل

الوصف الأصلي من المؤلف

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

الشعبية

نجوم GitHub
29k
الترتيب
#9366
الترخيص
—
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة