Proper use of multiple stylesheets on the same page

I came across this HTML coding primer: http://css-tricks.com/examples/CleanCode/Beautiful-HTML.png .

Among other things, it is recommended that you use one style sheet per page . I have CSS styles created in different style sheets:

  • Global (for all pages)
  • Forms (for all forms)
  • Customers (for all pages related to customers)
  • ... etc.

If I have one style sheet per page, it will not lead to huge redundancy? Wouldn't I finish dozens or hundreds of style sheets, many of which contain the same definitions?

How do you rate this practice? What are your opinions on the primer?

------ UPDATE ------

I understand that saying β€œone style sheet per page” does not necessarily mean that he has many style sheets throughout the site, so this raises a simple question about the next steps.

Based on your answers, is it advisable to have one style sheet covering my entire site, which can contain thousands of lines and hundreds / thousands of unused lines for the specific page on which it is loaded? (My style sheets are high in rows because I tend to put each style for a given class on a new line.)

+3
source share
3 answers

, , ; , . , , . ,

. , . , , ( ) . , , , , .

, , , , - .

+4

:

..

.

, HTTP-, . , , . , , HTTP-. "" , .

0

Having only one style sheet minimizes the number of resource requests . I work a lot at Drupal, which can cache style sheets automatically. For convenience, I will develop in several style sheets, but then cache them for production. On sites other than Drupal, I will do it manually.

Also worth noting: IE 6 and 7 load the first 31 styles .

0
source

Source: https://habr.com/ru/post/1763048/


All Articles