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
Load same stylesheets in the Site Editor as in the frontend #36911
Load same stylesheets in the Site Editor as in the frontend #36911
Conversation
.woocommerce-tabs { | ||
padding-top: var(--wp--style--block-gap); | ||
|
||
ul.wc-tabs { |
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.
Because the Product Details block is not inside a .woocommerce
wrapper in the editor, we needed to move these styles out of .woocomerce { ... }
. The change shouldn't be problematic because these classes are all prefixed with .woocommerce-
or .wc-
, so there won't be conflicts with styles from WP core or other plugins.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #36911 +/- ##
==========================================
- Coverage 46.7% 46.7% -0.0%
- Complexity 17178 17180 +2
==========================================
Files 429 429
Lines 64779 64784 +5
==========================================
Hits 30242 30242
- Misses 34537 34542 +5
|
Test Results SummaryCommit SHA: 00b8a8e
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
All Submissions:
Changes proposed in this Pull Request:
Currently, in the Site Editor we are only loading two frontend styles:
/assets/css/woocommerce.css
and/assets/css/woocommerce-blocktheme.css
. However, in some circumstances, there might be more CSS files or they might be replaced by others, for example, when using TT2 or TT3, which replace/assets/css/woocommerce.css
with their own stylesheet. We would like to honor that in the editor so frontend and editor look as similar as possible.This PR uses
WC_Frontend_Scripts::get_styles()
to get the list of styles which are loaded in the frontend to load them in the Site Editor.How to test the changes in this Pull Request:
Other information:
pnpm --filter=<project> changelog add
?FOR PR REVIEWER ONLY: