Different sources recommend different methods for optimizing resources when creating a style sheet, but is the practice of reducing identifiers for elements common? So I understand that the interpreter still needs an identifier or a class of an element, but it would be nice to cut files by several tens of kilobytes, thereby slightly increasing the speed of loading resources from the server. For example, there is such code:

.my-class { /* style */ } 
 <div class="my-class"></div> <div class="my-class"></div> <div class="my-class"></div> 

And replace it with:

 .mc { /* style */ } 
 <div class="mc"></div> <div class="mc"></div> <div class="mc"></div> 

How do you feel about this method? Correct in something, if not right.

2 answers 2

The article in the commentary on the question from @ soledar10 is required to read.
These savings on class names are not worth their savings.
Much more important is well supported code and clear classes.
This optimization can be done in other ways, for example: gzip, static caching, building a page on the client side.
In your case, nginx at a lower cost per config will do enough for good optimization.

    This is a useless exercise. Any compression algorithm (for example, gzip) will immediately automatically reduce all these classes to even more compact dimensions. When naming it is necessary to adhere to generally accepted agreements and be guided by convenience when developing.