वेब डेवलपमेंट
CSS Minify / Beautify
प्रोडक्शन के लिए CSS संकुचित करें या संकुचित CSS को पढ़ने योग्य रूप में फ़ॉर्मेट करें।
पूर्वावलोकन के लिए बहुत बड़ा
पूर्वावलोकन के लिए बहुत बड़ा
Minifying CSS strips whitespace, comments, and line breaks that only exist for human readability and have no effect on how a browser applies styles. The result is a smaller file and a faster page load.
How to use it
- Minify: paste CSS and the tool strips unnecessary whitespace, comments, and line breaks while keeping behavior identical.
- Beautify: paste minified CSS with no indentation to get a readable version back, with indentation and line breaks.
- Handy for quickly reading CSS from a third-party site that only ships a minified version.
Common uses
- Minifying CSS for production when there's no build tool (Vite, Webpack) set up, or for a quick one-off minification.
- Beautifying minified CSS from a third-party library to read or debug it.
- Estimating how much a CSS file will shrink before setting up an automated build.
Things to keep in mind
Minification never changes styling behavior — it's a purely syntactic transformation; if a page looks different after minifying, that's a bug in the tool, not an intentional change.
Without a source map, debugging minified CSS in production is harder — the line numbers shown in the browser console won't match the original file.
इस टूल के बारे में लेख: CSS मिनिफ़िकेशन: फ़ाइल से वाक़ई क्या हटाया जाता है, और क्यों
अक्सर पूछे जाने वाले प्रश्न
मिनिफ़ाई करना वास्तव में मेरे CSS से क्या हटाता है?
Minify व्हाइटस्पेस, लाइन ब्रेक्स और कमेंट्स हटाता है और कुछ वैल्यूज़ को छोटा करता है, जिससे CSS के व्यवहार को बदले बिना फ़ाइल का आकार कम हो जाता है।
क्या Beautify मेरी मूल फ़ॉर्मेटिंग को पूरी तरह से बहाल कर सकता है?
Beautify पठनीयता के लिए मिनिफ़ाई किए गए CSS को इंडेंटेशन और लाइन ब्रेक्स के साथ फिर से फ़ॉर्मेट करता है, लेकिन कमेंट्स या आपकी मूल स्टाइल चॉइस वापस नहीं ला सकता, क्योंकि वे मिनिफ़िकेशन के दौरान पहले ही हटा दी गई थीं।
क्या मिनिफ़िकेशन किसी भी वैध CSS के लिए सुरक्षित है?
हां — सिंटैक्टिकली वैध CSS के लिए, मिनिफ़ाई करना केवल अनावश्यक कैरेक्टर हटाता है और कभी सेलेक्टर्स या प्रॉपर्टी वैल्यूज़ नहीं बदलता, और सब कुछ स्थानीय रूप से आपके ब्राउज़र में चलता है।
अगर सर्वर पहले से Gzip के ज़रिए फ़ाइलें कम्प्रेस करता है, तो क्या मिनिफ़िकेशन की भी ज़रूरत है?
हां — मिनिफ़िकेशन और Gzip/Brotli कम्प्रेशन एक-दूसरे को कॉम्प्लीमेंट करते हैं: मिनिफ़िकेशन कम्प्रेशन से पहले ही सोर्स फ़ाइल को छोटा कर देती है, और Gzip/Brotli ट्रांसफ़र के दौरान रिज़ल्ट को और कम्प्रेस कर देता है, इसलिए साथ में दोनों तकनीकें अकेले किसी एक से छोटा फ़ाइनल साइज़ देती हैं।
मिनिफ़ाइड CSS के लिए source map क्या होता है?
source map एक अलग फ़ाइल है जो मिनिफ़ाइड CSS की लाइनों को ओरिजिनल, फ़ॉर्मेटेड कोड से मैप करती है, जिससे डीबग करते वक़्त ब्राउज़र डेव टूल्स सही लाइन नंबर और फ़ाइल नाम दिखा पाते हैं, भले ही प्रोडक्शन में मिनिफ़ाइड वर्ज़न ही लोड हो रहा हो।