-
Notifications
You must be signed in to change notification settings - Fork 188
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
Expose injectStyleOnce
#344
Comments
I'm no longer a maintainer of this codebase, so please don't take my opinion with too much weight. I have a strong belief that keeping a minimum API surface area is valuable because of the ability it affords library authors to change implementation details. So if I were still a maintainer of this codebase, I'd be hesitant to increase the API surface by exposing an implementation detail for other use. An alternative strategy for doing this kind of thing that imposes a different kind of burden would be to create a library which exposes this, have aphrodite depend upon it, and have your project depend upon the |
I think a minimal API surface area makes sense, but I think that it also may make sense to expose injectStyleOnce as part of that. If I am using Aphrodite, chances are likely that any global styles I want to introduce should use the Aphrodite styling interface (inject into the to: @lencioni |
I have a need to inject some global CSS at the root separate from the component-based pipeline. Right now, I'm duplicating a lot of the code in
injectStyleOnce
(https://www.github.com/Khan/aphrodite/blob/master/src/inject.js#L181-197), but it'd be nice to support this usecase out of the box and export the function with the built package, a laflushToStyleTag
.See https://github.com/Khan/aphrodite/blob/master/dist/aphrodite.umd.js#L2072-L2079 for the current exports.
Thanks!
The text was updated successfully, but these errors were encountered: