Recently I saw a site with ~ 7000 lines of CSS code inside a single style file. That's the question: is all this code written by hand or generated by something?

  • There are many tools for generating styles. If a specific site is interesting, then you can copy the class name or identifier and google it. Names of style files can sometimes also be communicated with what they are generated. - Alexandr Sysoev
  • one
    Well, seven thousand lines are not so difficult to write and manually - andreymal

1 answer 1

True, most likely this code is generated by something, although nothing, of course, does not prevent him from writing manually. Generations are of three types:

  1. Concatenation (union) of multiple files into one. This is the case when you can use many third-party libraries and plug-ins for your site that contain some of their own separate files, and you want to merge them all into one file, for the sake of the speed of the site. Look at the Webpack tool for example. Simultaneously with this operation, code minification is also usually done when it is maximally compressed in size - all excess spaces, hyphens, and the like are removed.
  2. Code generation with all preprocessors. This is when you write your code in their language, and their preprocessors later deploy it to css code that is understandable to all browsers. Look towards LESS , SASS .
  3. Code generation with all kinds of visual site editors, both locally installed and online. Then you don’t touch the code at all, it is generated by the robot. In the first case, you can look in the direction of Adobe Muse, in the second in the direction of LPGenerator , for example.