Transform styles utility doesn't prefix CSS selectors correctly for some complex selectors #64395
Closed
2 tasks done
Labels
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
transformStyles()
styles utility works incorrectly for some special selectors. I assume this is because of an issue inpostcss-prefixwrap
which is used bytransformStyles()
. I did try to reproduce this issue inpostcss-prefixwrap
but their test setup is giving me some headaches.Step-by-step reproduction instructions
Easiest way to reproduce it is to add the following CSS snippet in the block editor while the iframe isn't present, so that the prefixing with
.editor-styles-wrapper
takes place.The resulting CSS is this (WRONG):
As you can see, the
.test
prefix is added after every comma, which is obviously incorrect. The correct output would be this (CORRECT):I know this potentially involves work on the parser but I'm happy to do it if you give me some pointers on where to start looking. If the way is debugging
postcss-prefixwrap
, I will do that.Screenshots, screen recording, code snippet
Easiest way to reproduce this problem is to add the following test case in the
packages/block-editor/src/utils/test/transform-styles.js
test file:You will see that the output is as above.
Environment info
trunk
branchPlease confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: