Khan / aphrodite

Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation
5.34k stars 188 forks source link

How to generate class names without hash ? #377

Closed golubvladimir closed 5 years ago

golubvladimir commented 5 years ago

In documentation:

const styles = StyleSheet.create({
  foo: {
    color: 'red'
  },

  bar: {
    color: 'blue'
  }
});

Generate:

.foo_im3wl1 {
  color: red;
}
.bar_hxfs3d {
  color: blue;
}

I want:

.foo {
  color: red;
}
.bar {
  color: blue;
}

How to do it ?

jlfwong commented 5 years ago

Hi @golubvladimir,

There's intentionally no way to do this.

The hashes included in Aphrodite are fundamentally necessary for the design of Aphrodite to work correctly with server-side rendering and to avoid class name collisions between files.

So I think it's unlikely aphrodite will be updated with an option that allows the hashes to be removed entirely.