Answer the question
In order to leave comments, you need to log in
What is the optimal css file size?
It's kind of a philosophical question.
I was making up the site and found out that minified css takes 138kb. And it is not clear whether this is a lot or a little. The site is quite average in size, and the styles of everything that is there are stored in the file. Styles compiled in sass.
So I thought about how to do it more kosherly: put the styles of the entire site into one file - it turns out big and bold, for that you download it 1 time and don’t worry.
Or is it better to break css into pages. Well, that is, of course, there is a file with basic styles, then a file for one page, then for another ... and so on.
Well, you understand in short.
Answer the question
In order to leave comments, you need to log in
Up to a megabyte can reach large projects. Don't sweat it. Minification + gzip and everything is in chocolate.
138kb is normal (if you do not have a business card site).
Google recommends packing all styles into one file so that there are fewer http requests. But if your pages take a long time to load, then it makes sense to move the base styles to a separate file and load it first. but google doesn't like it. a compromise is to put the base styles in the style tag at the top of the page, but this approach is frowned upon by many.
Everyone writes correctly - enable Gzip. You can check it here:
www.whatsmyip.org/http-compression-test
"Shipping into one file" is a normal practice. You can break it into sections, which differ greatly in design and in versions for different screen sizes. Especially if styles take up a significant proportion of the total volume.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question