RevealTheme logo

أداة تصغير CSS

أزل التعليقات والمسافات البيضاء والأحرف غير الضرورية من CSS لتقليل حجم الملف.

كيفية استخدام هذه الأداة

  1. 1

    Paste your CSS — a single rule, a component stylesheet, or an entire file.

  2. 2

    The minified result and the byte savings appear instantly below the input.

  3. 3

    Copy the minified output, or compare the before/after byte count to see the reduction.

ما هي أداة تصغير CSS؟

يُحمَّل CSS المصغّر بشكل أسرع: كل بايت مهم في مسار العرض الحرج. يزيل التصغير التعليقات، ويطوي المسافات البيضاء، ويبسّط الصيغة (على سبيل المثال، 'color: #ffffff' يصبح 'color:#fff'). للمواقع في الإنتاج، استخدم أداة تصغير في وقت البناء مثل cssnano؛ هذه الأداة مخصصة لمقتطفات CSS العابرة.

حالات الاستخدام الشائعة

  • Shrink a critical-CSS snippet you're inlining into the <head> to remove a render-blocking request.

  • Compress CSS for an HTML email or newsletter, where every kilobyte counts and there's no build pipeline.

  • Paste CSS into a CMS or page-builder field that doesn't minify automatically (WordPress 'Additional CSS', Shopify theme settings).

  • Check how much weight a third-party stylesheet adds before deciding whether to self-host it.

  • Clean up CSS copied from DevTools, which arrives with computed-style comments and inconsistent spacing.

  • Produce a one-line version of a rule to paste into a chat, ticket, or code-review comment.

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

هل سيُفسد التصغير CSS لدي؟
لا: يحافظ التصغير على الدلالة. إذا تعطّل CSS لديك، فإن المصدر كان يحتوي على أخطاء في الصيغة تساهلَ معها المتصفح لكن أداة التصغير لم تتساهل.
ما مقدار تقليل الحجم الذي يمكنني توقّعه؟
بين 20% و40% في CSS المكتوب يدويًا نموذجيًا. وأقل من ذلك في CSS المضغوط بالفعل من أطر العمل.

أدوات ذات صلة