In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article Xiaobian for you to introduce in detail "what are the five tools for CSS performance optimization", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "what are the five tools for CSS performance optimization" can help you solve your doubts.
TestMyCSS
TestMyCSS is a free online optimization tool with many features. It can be used to check code redundancy, verify errors, unused CSS, and seek best practices. Programmers only need to type the URL into the CSS file of the website and start using it immediately, and TestMyCSS can find all the projects that need to be improved. Not only that, programmers can also see some useful tips:
How to simplify complex selectors
Duplicate CSS properties and selectors that need to be removed
The number of important declarations that exist in the code
Unnecessary class specificity
Unnecessary IE repair
CSS attribute that does not require a vendor prefix
A class or ID rule with a signature, such as a.primary-link
Improper use of universal selector
Stylelint
StyleLint is a fairly powerful CSS linter that works with PostCSS (a development tool) to write state-of-the-art CSS,linter, a program that catches potential errors through code.
StyleLint can be used to:
Check for spelling errors, such as typos, invalid hexadecimal colors, repeat selectors, etc.
Seek best practice implementation
Uniform coding style, such as consistent spacing in each CSS rule, etc.
Support for new top-level CSS syntax
Use stylefmt to automatically fix some warnings, a tool for formatting CSS rules
.
StyleLint is so powerful that programmers can use what it has:
StyleLint CLI (Command Line Interface)
Build plug-ins for tools, such as webpack,gulp, etc.
Plugins for text editors, such as Atom,Sublime Text.
StyleLint Node API
StyleLint PostCSS plug-in
CSS Triggers
CSS Triggers provides an online reference for page parsing, which allows programmers to learn which CSS properties trigger redrawing and compositing, but not layout, which is what browsers do when rendering a web page.
Layout: the browser generates the geometry and position of each element
Paint: the browser parses the pixels of each element into layers
Composite: browsers draw layers on the screen.
Compositing is the cheapest operation performed by browsers, and if your CSS animation code repeatedly triggers the properties of compositing and redrawing operations, it is difficult to use 60fps (frames per second) as the key number for smoothing web animations.
Cssnano
When using CSS to render the critical path of a page, it becomes important to use a compact, well-structured stylesheet document. In other words, the default browser web page rendering process does not stop until the stylesheet is loaded, parsed, and executed. Therefore, if the CSS document is large and cluttered, the site will take a long time to load.
Cssnano is the CSS optimization and decomposition plug-in for PostCSS. Cssnano uses a well-formed CSS and goes through many optimizations to ensure that the final production environment is as small as possible.
Critical
Critical is another tool for dealing with the CSS critical path problem mentioned in the previous section. For best performance, programmers may need to consider inserting critical CSS directly into HTML documents, as this eliminates extra round trips to critical paths.
The concrete practice of this idea is to find key CSS rules and place them in the section of the HTML document. Critical generates and inlines the critical path CSS, and programmers can use both Grunt and Gulp.
After reading this, the article "what are the five tools for CSS performance optimization" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.