-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add editor styles entry point #617
Conversation
Okay, big update on everything here so I'm just going to do a whole PR review below. tldr: we don't actually need any extra entry points because loading the styles in the backend via We'll want to test this to make sure there aren't any other conflicts! DESCRIPTIONAdds our We don't need to generate any other stylesheets because The only addition we've had to make so far is this in our
This is because the WP admin The bonus of doing things this way is that we don't need to do any extra compiling, so our build times don't change at all. SCREENSHOTSOTHER
STEPS TO VERIFY
DOCUMENTATIONProbably yes still, just to mention the use of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏻 👏🏻
Everything works beautifully on my end. Thanks @coreymcollins
Thanks! I think we'll still want to do some testing to make sure there aren't any other style collisions but I think functionally this makes sense (so far). I've noticed some WDS Block styles and functionality aren't coming through fully, like the accordion, so there may be some additional global admin styles to override. |
Though now that I'm thinking about it – we should probably worry about testing/fixing styles for the WDS Blocks blocks in the plugin rather than the theme? I think I was still holding onto the mindset of the blocks living in the theme like they used to. |
I don't think this closes any issue, but it's related to a couple of things noted in #614.
DESCRIPTION
Adds a new entry point for editor styles in
/src/editor/editor.js
.This also updates our npm scripts from using our
wds-build
andwds-start
scripts towp-scripts
so that we can easily modify our entry points:This does increase compiling times when running
npm run start
on my machine from around 2600ms onmain
to around5000ms
in this branch. It'd be great to reduce that number as much as possible, of course, if we can.Since editor styles are added through theme support hooks, we don't need to worry about wrapping our Tailwind or theme styles in a tag to scope them – this happens naturally:
SCREENSHOTS
OTHER
STEPS TO VERIFY
npm install
npm run build
to do a full build and check your editor and frontend stylesnpm run build:editor
to ONLY compile editor styles. NOTE: this ONLY compiles editor styles and NOT styles on the frontend. We may not even need this, but it is useful for testing so if we decide to go this route we could keep it in until we want to merge then yank it out.npm run start
and/ornpm run start:sync
to start the watch process and make some changes, then check the editor and frontend. Compile times did not differ for me running the basicstart
versus the Browsersyncstart:sync
.DOCUMENTATION
I think probably, yes – we'll want to mention the update to our npm scripts and how we're including editor styles.
Assigning to @gregrickaby for review but also cc @michealengland to test out and compare to his work in another branch. We may be able to combine some thoughts around this to get a more efficient process running.