Media queries or multiple style sheets?

0

In order to make the site fast and responsive, which is better?

1-Use Media Queries and set the resolutions in just one style sheet.

2-Use multiple stylesheets that will be called in HTML according to the resolution.

    
asked by anonymous 23.01.2017 / 15:05

1 answer

0

It is recommended to use only one style sheet file (.css). Below is a list of pros and cons. Remembering that it's just recommendations and observations ... any of the methods is effective.

Pros of a .css file:

  • 1 HTTP request;
  • Easier not to forget to update some specific Media Query.

Cons of an .css file:

  • File size is larger;
  • The larger the project, the more difficult the maintenance;
  • Required JavaScript solutions to work in IE8 down.

Pros of using multiple files:

  • Default file is smaller;
  • Facilitates maintenance and organization.

Against using multiple files:

  • Multiple HTTP requests;
  • It worsens maintenance over forgetting to update an item in a particular file.
24.01.2017 / 13:53