Search code examples
phpstorm

How to get additional details for PHPStorm warnings?


I got the following warning:

Optimize background properties

This inspection tries to find similar CSS properties, which can be transformed to shorter form (shorthand; padding for individual sides can be shortened to 'padding' shorthand if possible, etc).

on this line of CSS:

background: url('../icons/loading.gif') no-repeat right center;

Is there a way to know what PHPStorm wants me to do with my CSS declaration?


Solution

  • Inspection is not triggered for just this line, can you provide a complete example? Maybe there is another background attribute in your style that can be merged into this one? Normally you press Alt+Enter, Enter to activate the inspection and see the results after applying it. If it's not what you want, just Undo.

    Here is the example (before):

    background-repeat: no-repeat;
    background-position: right center;
    background-image: url('../icons/loading.gif');
    

    (after):

    background: url('../icons/loading.gif') no-repeat right center;