-
Notifications
You must be signed in to change notification settings - Fork 4
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
Introduce an add_editor_style function #32
Labels
help wanted
Extra attention is needed
Milestone
Comments
@Sephsekla Thoughts on whether this would be useful in a 1.0? Re: #40 |
Closed
I think this would be more useful if we could get something like humanmade/webpack-helpers#7 finalized, and the time might be right to do that now? |
Noting a rough implementation of how the manifest is manually read and the specified asset enqueued on another project $json = file_get_contents( $manifest );
$json_data = json_decode( $json, true );
if ( isset( $json_data['editor.css'] ) ) {
add_editor_style( __DIR__ . "/../../build/{$json_data['editor.css']}" );
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add_editor_style
takes a theme-relative path to a stylesheet, and enqueues that stylesheet as an editor asset. Given that hashed filenames can make it challenging to use editor stylesheets, we should consider introducing a helper method which can take the name of a bundle in the manifest and ensure it gets ingested as an editor stylesheet.Pseudo-code from #35 which we'd want to wrap in an
Asset_Loader\add_editor_style()
top-level function:The text was updated successfully, but these errors were encountered: