Search code examples
htmlcssphpstormminifyunminify

Unminifying CSS in PhpStorm


I'm working in PhpStorm 2016.3.2. In my HTML files sometimes found <style> tags and minified CSS inside them.

Is it possible to make a shortcut to unminify code inside this tags?

For example, this code:

<style>.arrow{fill:none;stroke:#231f20;stroke-linecap:round;stroke-miterlimit:10;stroke-width:20px;}</style>

should looks like this:

<style>
.cls-1 {
   fill: none;
   stroke: #231f20;
   stroke-linecap: round;
   stroke-miterlimit: 10;
   stroke-width: 20px;
}
</style>

Solution

  • To reformat code for a directory, follow these steps:

    1. In the Project tool window, select a module or directory you want to apply your reformatting to.
    2. From the main menu, select Code | Reformat Code or press Ctrl+Alt+L. Alternatively, in the Project tool window, right-click the directory and from the context menu, select Reformat Code.
    3. In the Reformat Code dialog box, specify the necessary options and filters for you reformatting and click Run.

    To reformat code for the current file, follow these steps:

    1. In the editor of the currently opened file, press Ctrl+Shift+Alt+L.

    2. In the Reformat File dialog, specify options for the reformatting and click Run.