Code Inspections in CSS
This topic lists all PhpStorm code inspections available in CSS.
You can toggle specific inspections or change their severity level on the Editor | Inspections page of the IDE settings Ctrl+Alt+S.
Probable bugs
| Inspection | Description | Default Severity |
|---|---|---|
| Missing comma in selector list | Reports a multi-line selector. Most likely this means that several single-line selectors are actually intended but a comma is missing at the end of one or several lines. | |
| Missing generic font family name | Verifies that the font-family property contains a generic font family name as a fallback alternative. Generic font family names are: | |
| Non-integer length in pixels | Reports a non-integer length in pixels. | |
Code quality tools
| Inspection | Description | Default Severity |
|---|---|---|
| Stylelint | Reports a discrepancy detected by the Stylelint linter. | Disabled |
| W3C CSS validator | Reports a discrepancy detected by the W3C CSS Validator. | Disabled |
Code style issues
| Inspection | Description | Default Severity |
|---|---|---|
| Missing semicolon | Reports a missing semicolon at the end of a declaration. | Disabled |
| Redundant measure unit | Reports a measure unit of a zero value where units are not required by the specification. width: 0px | |
Invalid elements
| Inspection | Description | Default Severity |
|---|---|---|
| Invalid function | Reports an unknown CSS function or an incorrect function parameter. | |
| Invalid media feature | Reports an unknown CSS media feature or an incorrect media feature value. | |
| Invalid property value | Reports an incorrect CSS property value. | |
| Invalid pseudo-selector | Reports an incorrect CSS pseudo-class pseudo-element. | |
| Invalid type selector | Reports a CSS type selector that matches an unknown HTML element. | |
| Misplaced @import | Reports a misplaced | |
| Misplaced or incorrect @charset | Reports a misplaced | |
| Negative property value | Reports a negative value of a CSS property that is not expected to be less than zero, for example, object width or height. | |
| Unknown at-rule | Reports an unknown CSS at-rule. | |
| Unknown property | Reports an unknown CSS property or a property used in a wrong context. | |
| Unresolved class in 'composes' rule | Reports a CSS class reference in the 'composes' rule that cannot be resolved to any valid target. | |
| Unresolved custom property | Reports an unresolved reference to a custom property among the arguments of the | |
| Unresolved file reference | Reports an unresolved file reference, for example, an incorrect path in an | |
Other inspections
| Inspection | Description | Default Severity |
|---|---|---|
| Color could be replaced with #-hex | Reports an | Disabled |
| Color could be replaced with rgb() | Reports an | Disabled |
| Overwritten property | Reports a duplicated CSS property within a ruleset. Respects shorthand properties. | |
| Properties may be safely replaced with a shorthand | Reports a set of longhand properties. Suggests replacing a complete set of longhand CSS properties with an equivalent shorthand form. | |
| Properties may probably be replaced with a shorthand | Reports a set of longhand CSS properties. Suggests replacing an incomplete set of longhand CSS properties with a shorthand form, which is however not 100% equivalent in this case. | |
| Property is incompatible with selected browsers | Reports a CSS property that is not supported by the specified browsers. Based on the MDN Compatibility Data. | Disabled |
| Unused selector | Reports a CSS class or an element IDs that appears in selectors but is not used in HTML. | |