Rebelmail/html-uglify

BEM support

Opened this issue · 0 comments

mir3z commented

This great tool apparently does not handle BEM notation. Consider the following example:

<html>
   <head>
      <style>
         .foo {}
         .foo__bar {}
      </style>
   </head>
</html>
<body>
   <div class="foo"></div>
   <div class="foo__bar"></div>
</body>

After tranforming via html-uglify:

  • foo is replaced by xz which is fine
  • foo__bar is replaced by xz__bar which can be further optimized

I expect foo__bar is replaced as a whole selector.