Hacker News new | ask | show | jobs
by chinchang 3958 days ago
This seems like too much abstraction (magic) of things. Plus those auto generated classes really look odd and would make debugging difficult.
2 comments

Webpack allows you to change the format through its loader configuration. Perhaps, this could get implemented to CSS Modules too, if it’s not already.

loaders: [

  ...
  {
    test: /\.css$/,
    loader: 'css?localIdentName=[name]__[local]___[hash:base64:5]'
  }
]
I assume soucemaps would solve this.
It's lovely to assume this, but I see no mention of sourcemaps anywhere. This was my immediate gripe, debugging.

Yea, the class name should point you to the file you want to look at, but that is still manual legwork. And the whole atomic css-like pitch he has with the over-the-top `composes` functionality looks like its own nightmare.

I'll watch from over here and see if this pans out for ya'll.

I can't speak from experience with regards to this particular approach, but I've worked with css-modules with webpack (css-loader), and debugging the class names is no problem at all, CSS source-maps point to the source, you can view the source code within your developer tools. It shouldn't really be any different than debugging Sass generated CSS, for example.