-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefix className with propName in development. #739
Comments
I wrote a stylex patch in RSD to prefix class names with the prop name: https://github.com/facebook/react-strict-dom/blob/main/patches/%40stylexjs%2Bbabel-plugin%2B0.7.5.patch#L52 I would be wary of trying to generate tailwind-like classes, even if it's only in dev, because people will simply try to write selectors against them. We already had an issue internally where a patch was landed to target a StyleX dev classname. It was communicated to the CSS BE team that we'd switch to dev |
The initial goal is only to make the classes a bit more readable in development. We can start with prefixing class names with the prop name. and leave the hashes for the value part. |
See also #184 |
Done in #742 |
Describe the feature request
Right now, we hash the <list of “conditions”>++ to generate classNames for everything!
Instead: For common, key-value pairs, such as margin:0, generate small readable classNames, such as: m-0
We'll want to add this in as a config option to
StyleXOptions
Some examples:
The text was updated successfully, but these errors were encountered: