On the CSS side I already compile and minify the CSS file.
Doubts began to surface when I noticed that some sites work with a type of compile including HTML files. In other cases, such as Facebook, there are several classes with the name well differentiated, looking like it was coded, as in the picture below:
Is this really some kind of class / name encoding? It seemed strange to me, since both the css
file and the html
file are easily accessible to the client.
But contrary to that, I see some good points in using this. It may give a slightly greater difficulty in understanding the context / purpose of that class, since it would not have such an intuitive name as nav.menu_mobile
. Or, leave the source of the project with greater freedom in using the class name without leaving an extensive and exaggerated HTML. For example, you could create classes with names cadastro_cliente
, cadastro_cliente_dependente
, and in compilation would be just a simple code of 4-5 letters, as in the example.
Would this really be a form of compilation or just an internal convention starting from development?
Another question would be in the compilation part of the HTML file. I already know that it is possible, but I do not know how far this practice is recommended, since in some cases the HTML hierarchy changes the structural behavior (depending on the CSS structure). For example:
<ul>
<li></li>
<li></li>
<li></li>
</ul>
Behave differently from this code:
<ul><li></li><li></li><li></li></ul>
I'm new to major project maintenance. Now I am working on one that is really challenging and great so I would like to know how far I can go with these questions. I know that in terms of performance this may not have such a significant impact that it will be advantageous to spend so much time focusing on this aspect.
But if it's worth it, for the sake of optimization, organization and improvement, I think it's worth it.