URL-Decode

CSS Lint

Convert
Errors
Compatibility
Performance
Maintainability & Duplication
OOCSS
Accessibility
Result
line column title description browser

CSS Lint is a free online tool that helps you point out problems in your CSS code. It is a primary syntax validation tool that implements rules that look at problematic patterns and signs of inefficiency in your CSS code. Performance optimization, error correction, OOCSS, and compatibility checking can be performed in CSS Lint to make your CSS code more efficient.

What exactly is a Lint?

According to Wikipedia, Lint (software) means
Lint or linter is a code analysis tool that flags programming errors, such as bugs, stylistic mistakes, and suspicious constructs, and their questionable usage in software or programs written in any computer language.
Therefore, lint is a performance checker that checks for problematic patterns in your code that cause inefficiency.

Why is CSS Lint important?

Coding is challenging because a small mistake can affect the whole performance of your code. Just writing code is not enough. However, writing CSS code that is error-free and efficient is of the utmost importance.

We learn from our mistakes. No one can become a “ Mentor" at the start in any field. In any area of life, we have to start from the basics. With time, by facing new problems and challenges, we learn from our mistakes, and after some time, we achieve perfection.

The same goes for programming. Getting your program checked by a " pro," "Senior," or "Mentor" is a great way to improve your programming skills. However, if that facility is unavailable, you can use the lint for that language.

Performance cannot be sacrificed at any cost. CSS lint is a tool for checking the browser's CSS performance. CSS lint performs the CSS code's basic syntax checking to point out your CSS code's problems.
That is required in an established organization where you work on big projects with a team of skilled developers, such as mammoth-type projects. Moreover, you must optimize the page performance to the level the tool aims to achieve.

The CSS Lint Rules

Nicholas Zakas and Nicole Sullivan created the CSS Link, which applies rules to the code to identify problematic patterns that cause inefficiency. The rules are divided into sections on Errors, Maintainability, Duplication, Compatibility, OOCSS, Performance, and Accessibility.

Errors

  • Beware of broken box-sizing.
  • Require properties appropriate for.
  • Disallow duplicate properties.
  • Disallow empty rules.
  • Require the use of known properties.

Maintainability and Duplication

  • Disallow too many floats.
  • Do not use too many font sizes.
  • Disallow IDs in selectors.
  • Disallow ! important.

Compatibility

  • Disallow adjoining classes
  • Disallow box-sizing.
  • Require compatible vendor prefixes.
  • Require all gradient definitions.
  • Disallow negative text-indent.
  • Require standard property with the vendor prefix.
  • Require fallback colors.
  • Disallow the star hack.
  • Disallow the underscore hack.
  • Bullet-proof @font-face.

OOCSS

  • Disallow qualified headings.
  • Heading should only be defined once.

Performance

  • Do not use too many web fonts.
  • Disallow @import.
  • Disallow duplicate background images.
  • Disallow selectors that look like regex.
  • Disallow universal selector.
  • Disallow unqualified attribute selectors.
  • Disallow units for 0 values.
  • Disallow overqualified elements.
  • Require shorthand properties.

Accessibility

  • Disallow outline: none.

Note How many rules you want to apply, it depends upon you. These rules are pluggable. If you will use all the rules, you can select all or omit some you do not want to apply.

How to use the CSS Lint tool?

Use the CSS Lint tool for performance optimization, error correction, OOCSS, and compatibility checking to make your CSS code more efficient and problem-free. You must perform the following steps.

  • Open the CSS Lint tool.
  • You can copy-paste or upload the CSS code using the "Load From URL" or "Browse" option.
  • After uploading the code, select the "rules" from the checklist you want to apply. If you wish to use all the rules, check all the rules. If you are involved in some specific rules, you can also apply those rules. It depends on you.
  • After selecting the rules, click on the "Convert" button.
  • The tool will give you the results.

How can the "Load Sample Data" option be used in the CSS lint tool?

Before using any online tool, it is always better to load sample data to check that the tool works and gives you results according to your requirements.

  • To use this, do the following steps.
  • Click the "Load Sample Data" option to upload the sample data.
  • Select the "rules" from the checklist to apply to the code.
  • Click on the "Convert" button to get the results.

Should we use CSS lint?

The answer is "yes." CSS lint helps you check basic syntax and identifies your code's problems, making your code more efficient. You may have questions or doubts about some rules. However, these rules are pluggable; if you want to omit specific rules, you can do that.
Also, try our CSS Beautifier online tool and CSS Minifier online tool for productivity improvement.

Do we keep a copy of your source code?

Protecting user trust is our top priority. For the CSS lint process, we do not keep a copy of the source code that the user inputs or uploads.