Monu Tools

Μορφοποιητής CSS

Ομορφύνετε CSS με καθαρές εσοχές, ή συμπιέστε το για να μειώσετε το μέγεθος αρχείου. Χειρίζεται media queries, calc() και σχόλια άδειας.

Πώς να χρησιμοποιήσετε το Μορφοποιητής CSS

  1. 01

    Επικολλήστε το CSS σας στο πλαίσιο εισόδου.

  2. 02

    Επιλέξτε Ομορφιά για μορφοποίηση ή Συμπίεση για συμπύκνωση.

  3. 03

    Επιλέξτε το μέγεθος εσοχής, μετά αντιγράψτε το αποτέλεσμα.

What the CSS formatter does

This is a CSS formatter that beautifies stylesheets with clean, consistent indentation, or minifies them to shrink file size. You choose the indent size for beautifying, and switch to minify when you want the smallest output.

When to beautify and when to minify

Readable CSS is easier to scan, review and debug: when each rule and declaration is indented consistently, you can see selectors, nesting and the shape of your media queries at a glance.

Minifying is for production. It removes the whitespace and comments that browsers do not need, so the file downloads faster. On a large stylesheet the saving adds up, especially before gzip compression on the server.

Careful minifying with calc() and media queries

The minifier is careful where it matters. It keeps the spaces around plus and minus inside calc(), so calc(100% - 30px) stays valid, and it only strips spaces around structural characters such as braces, colons and semicolons. It also handles nested media queries correctly.

License comments are preserved

License comments written in the /*! ... */ form are preserved, which is the standard convention for keeping copyright and license notices in minified output even when ordinary comments are removed.

Runs in your browser

Both beautify and minify run entirely in your browser, so your stylesheets never leave your device. The tool formats for readability and size; it does not validate that your CSS is correct.

Συχνές ερωτήσεις

Σπάει η συμπίεση τις εκφράσεις calc();

Όχι. Ο συμπιεστής διατηρεί τα κενά γύρω από το συν και το πλην μέσα στις τιμές, οπότε το calc(100% - 30px) παραμένει έγκυρο. Αφαιρεί μόνο κενά γύρω από δομικούς χαρακτήρες όπως άγκιστρα, άνω και κάτω τελείες και ερωτηματικά.

Αφαιρούνται τα σχόλια κατά τη συμπίεση;

Τα κανονικά σχόλια αφαιρούνται για εξοικονόμηση χώρου, αλλά τα σχόλια άδειας που γράφονται ως /*! ... */ διατηρούνται, που είναι η πρότυπη σύμβαση για τη διατήρηση ειδοποιήσεων πνευματικών δικαιωμάτων.

Ανεβαίνει το CSS μου κάπου;

Όχι. Τόσο η ομορφιά όσο και η συμπίεση εκτελούνται εξ ολοκλήρου στο πρόγραμμα περιήγησής σας, οπότε τα φύλλα στυλ σας δεν φεύγουν ποτέ από τη συσκευή σας.

Πηγές

Ενσωματώστε αυτό το εργαλείο

Προσθέστε αυτό το εργαλείο στον δικό σας ιστότοπο. Αντιγράψτε το παρακάτω απόσπασμα, ενημερώνεται αυτόματα.

<iframe src="https://monu.tools/embed/el/css-formatter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

Σχετικά εργαλεία