Is it a good practice to use two to three stylesheets for a web design. 1. framework that we are using, 2. Main stylesheet 3. Responsive stylesheet which would have media queries. How does it matter if we put media queries into the main stylesheet? Is there a difference in performance? What are the pros and cons of embedding 2 stylesheets instead of one?
Loading multiple stylesheets:
Unless you are frequently changing one of them, you will always get better performance by having them in a single file (this may change with HTTP2).
The only benefits to having them in separate files is for ease of development, but you should combine them at build time.
I'll recommend using CSS preprocessors, such as LESS/SASS.
Those allow additional leverage over CSS by providing additional syntax that delivers lots of advantages:
You can read more about this here: Advantages of preprocessors
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.