Code Inspections in CSS
This topic lists all GoLand code inspections available in CSS.
You can toggle specific inspections or change their severity level on the Editor | Inspections page of the Settings/Preferences Ctrl+Alt+S.
Probable bugs
Inspection | Description | Default Severity |
---|---|---|
Float px length | This inspection detects float values of pixel lengths. | Weak warning |
Missing comma | This inspection detects missing comma between selectors at the end of line. | Warning |
Missing generic font name | This inspection verifies that the CSS font-family property contains a generic font name as a fallback alternative. | Warning |
Missing measure unit | This inspection highlights CSS number property values for which no units of measurement are specified. | Warning |
Code quality tools
Inspection | Description | Default Severity |
---|---|---|
Stylelint | Runs Stylelint validator for specified stylesheet file. | Disabled |
W3C CSS validator | This inspection validates the CSS with W3C CSS validator library. | Disabled |
Code style issues
Inspection | Description | Default Severity |
---|---|---|
Missing semicolon | This inspection detects missing semicolon at the end of declarations. | Disabled |
Redundant measure unit | This inspection highlights zero values with specified unit of measurement. | Warning |
Invalid elements
Inspection | Description | Default Severity |
---|---|---|
Invalid CSS @charset rule | This inspection detects misplaced @charset rules and inappropriate charset values. | Warning |
Invalid CSS element | This inspection detects inappropriate values assigned to CSS attributes. For example, invalid measurement units or values out of range. | Error |
Invalid CSS function | This inspection detects unknown functions and illegal function parameters. | Error |
Invalid CSS media feature | This inspection detects unknown media features and illegal media feature values. | Error |
Invalid CSS property value | This inspection detects illegal property's values. | Error |
Invalid CSS pseudo-selector | This inspection detects unknown and inappropriate pseudo-classes and pseudo-elements. | Error |
Invalid CSS selector | This inspection detects unknown CSS selectors and provides ability to declare them as a class or an id. | Warning |
Misplaced CSS @import | This inspection detects misplaced CSS @import declarations. | Warning |
Negative CSS value | This inspection detects negative values assigned to CSS attributes that should never be negative. For example, object width or height. | Error |
Unknown CSS at-rule | This inspection detects unknown CSS at-rules. | Error |
Unknown CSS property | Highlights CSS properties that are unknown or used in wrong context, and allows to define such properties as 'custom' to avoid highlighting them as invalid. | Warning |
Unknown file or directory | This inspection checks references to files and directories. | Error |
Unresolved CSS Class | This inspection warns about CSS class references which cannot be resolved to any valid target. | Error |
Unresolved CSS Custom Property | This inspection warns about CSS custom property variable references which cannot be resolved to any valid target. | Error |
Other inspections
Inspection | Description | Default Severity |
---|---|---|
#HEX color representation instead of RGB color function | This inspection detects CSS colors which are defined as HEX, and provides a quickfix action to convert such values to a CSS rgb() function call. | Disabled |
Browser compatibility for properties | Reports CSS properties that are not supported by the specified browsers. This inspection is based on the MDN Compatibility Data . | Disabled |
Overwritten property value | This inspection highlights CSS properties, which are being overwritten in the same ruleset block. | Warning |
Properties may be safely replaced with a shorthand | If a CSS ruleset contains a complete set of longhand properties then this inspection suggests transforming them into a shorthand form. | Weak warning |
Properties may probably be replaced with a shorthand | If a CSS ruleset contains a number of longhand properties that do not constitute a complete set then this inspection suggests transforming the properties into a shorthand form. | No highlighting, only fix |
RGB color function instead of #HEX representation | This inspection detects CSS colors which are defined as CSS rgb() function and provides an intention to convert such values to its HEX representation. | Disabled |
Unused CSS selector | This inspection detects unused CSS classes or IDs within a file. | Warning |