Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Possibility to override the core class names #413

Closed
frenzzy opened this issue May 24, 2016 · 1 comment
Closed

Possibility to override the core class names #413

frenzzy opened this issue May 24, 2016 · 1 comment

Comments

@frenzzy
Copy link

frenzzy commented May 24, 2016

src/component/base/DraftEditor.react.js uses a special class names, for example:

  • DraftEditor/root
  • DraftEditor/editorContainer
  • public/DraftEditor/content
  • etc

But how we can see at facebook.com, it uses minimized 5-digit names of these same classes:
..looks like CSS Modules usage
facebook

How we can redefine Draft.js class names in our own projects the same way?
It seems at the moment the editor does not provide the api to change the core class names..

@sophiebits
Copy link
Contributor

This ties into our internal CSS build system and it's not going to be practical for us to support this in open source – it's unlikely that it will make a practical difference for anyone so hopefully it isn't a big deal for you. If you're interested, we statically transform calls to cx() using a Babel transform that replaces the class names with a minified version. (We never reference classes with a slash without using cx().) If you were motivated you could implement the same thing by building Draft from source but it's unlikely to be worth the time it would take you to set it up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants