-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use css-tree parser for wrapping theme styles #21742
Conversation
Add cleaning of wrapper class name. Update main package lockfile.
Nice PR, I'll plan to take a look at it in the upcoming days. |
@youknowriad: I also added a test for transforming the styles. (The test can be run individually using this invocation: |
Yes, if I remember properly, it was used to transform relative and absolute URLs in CSS rules. I'm not sure how it evolved though. |
@youknowriad: Ah, found the test for this:
Hm, I will reuse the existing tests, the build is currently failing because of some newlines or such, hm... |
@youknowriad: Based on the tests, support for |
Bad rebase? ;) |
@noahtallen: Yes, should I try to fix it or make a new PR? |
I think you should be able to fix it in the current PR. I would probably try:
|
Oh, when you are rebasing, do |
@noahtallen: Well, it turned out that some implementation details were missing. For preserving the original test structure I created a new PR that supersedes this one: #21936 |
Description
This PR adds the CSSTree parser for wrapping the theme styles into a styles wrapper.
How has this been tested?
I tested this on my local WordPress site.
Apparently there aren't tests (except some traversal stuff that had been only internally used anyway).
Edit:
baseUrl
passed in the rules objects to the method?Types of changes
(PoCs here: https://codepen.io/strarsis/pen/RwWRqZv and also https://codesandbox.io/s/busy-williamson-r1frp). (Not implemented with this PR, but
CSSTree
adds the foundation for it).Checklist: