-
Notifications
You must be signed in to change notification settings - Fork 69
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
Spike: investigate how we are importing & overriding styles from @wordpress/components
#8012
Comments
@mgascam Could you please add the details under TODO so that the issue can be assigned to the responsible team. |
This should be a coordinated effort here, as this is related to the JS components version used in the development and provided by the runtime. EDIT: removing from Pulsars board, this issue is for our JS guild lo look into. |
@haszari sending this one to your team's maintenance backlog. I've assigned the issue to you for this, please take care of adding it to the team board. |
Thanks @vbelolapotkov – added to our board, will set a priority soon. |
I will take another look at this to better understand the problem so helix can estimate and action. @haszari |
A good next step here is a spike to understand:
Once we know the options for reusing styles from the package (1 and 2 above), then we can make a plan for how to iterate towards reducing or removing our customisations/overrides (3). I'll update the title and description to focus on this spike, we can log other issues once we have more info! FYI @mgascam let me know if I'm missing anything, any feedback you have on this plan of action. |
@wordpress/components
Prioritised as That said, there's no urgency here, this could be |
A quick answer to this, as I was investigating for a discussion in #8382 WooPayments is importing The current version of Unfortunately, WooPayments has not kept up-to-date with component library versions as part of regular maintenance, and so an update to the current version will require effort that has not been easy to prioritise in the past – @Automattic/helix talked about this at our last meetup pdjTHR-3SB-p2. |
Refocusing this as a spike to better understand the problem. Spike will need to answer these questions:
@wordpress/components
.@wordpress/components
and get the styles.@wordpress/components
).Once we know the options for reusing styles from the package (1 and 2 above), then we can make a plan for how to iterate towards reducing or removing our customisations/overrides (3).
Read on for more info in original bug report (i.e. a symptom caused by current situation).
Describe the bug
There are missing CSS rules from the
wordpress/components
package in the compiled stylesheet for WC Admin that cause visual issues.For context, we noticed this issue while working on #7742. One of the requirements was to introduce a dropdown menu on the payment details screen. We decided to use the
DropdownMenu
from the wordpress/components package, but noticed that the positioning was not working. After investigation, it seemed that there were missing rule definitions in the CSS stylesheet of the WP Admin related to the wordpress/components.In my Docker based dev environment, these styles are loaded in
http://localhost:8082/wp-includes/css/dist/components/style.css?ver=6.4.2
To fix the missing styles we started importing the missing styles from the node_modules in the React component (here), but we needed to revert since this was causing visual issues in other instances of
DropdownMenu
.To Reproduce
N.B: This has been spotted in the payment details page with the
DropdownMenu
component, but potentially affects other parts of the codebase wherewordpress/components
are utilized.npm start
)Actual behavior
The DropdownMenu is misplaced in the layout:
Screenshots
Expected behavior
The DropdownMenu is properly placed in the layout:
Additional context
Slack discussion: https://a8c.slack.com/archives/C053VQPD74J/p1700490601899939
The text was updated successfully, but these errors were encountered: