For webpack:
You can configure the generated ident with the
localIdentName query parameter (default [hash:base64]).
Example for easier debugging:
css-loader?localIdentName=[path][name]---[local]---[hash:base64:5]
From the docs. Results in classes like these: src-components-MyFantasticComponent---myClass---3ZAMU
Other packaging systems that use CSS modules will probably offer something similar.I think the ugliness is driven from a goal to create globally unique class names, that wouldn't conflict with e.g. a pre-built widget that was pulled from a third-party CDN rather than passing through the same asset builder.
Which is not to say readability couldn't still be improved. Hopefully builders would have something akin to uglify options - how much do you want to minify and munge during your build process.
I see that there's nothing in this standard, however, that would prevent readable class names.
[0] https://github.com/webpack/css-loader#local-scope