-
Couldn't load subscription status.
- Fork 25
Fix component guide for applications without individual css loading #5087
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
Conversation
|
@AshGDS this is still a work in progress, but wanted to give you a heads up as it somewhat nullifies the work you did recently on loading other component's CSS on the preview pages - with this change we'll be loading all of the CSS on every page. |
|
Thanks @andysellick - is it possible to preserve the individual CSS functionality under a configuration flag? |
- include detail of how to get the component guide stylesheet included in an application not using individual css loading
31f5f53 to
825621e
Compare
- these two tests specifically check individual css loading within the component guide, which has now been disabled - other tests in this file use custom pages outside of the guide, where individual css loading still works
- this was very weird, have documented this change in #5099 as we may need to revert it and fix it properly
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.
Nice work Andy, the changes look good to me.
Thanks for also creating the related issue for the option select component test, I'll have a further look at this as well, it does look like the test itself could be a bit flawed as you mention in the issue description.
What
Fix the rendering of the component guide in applications that don't use the individual component css loading, by switching the component guide to import all of the CSS for all of the components by default and turn off the rendering for individual component css in the guide.
component_guide_stylesheetis a new method to pass into the applicationdartsassconfig to provide the component guide stylesheet. This is used in the existingall_stylesheetsmethod and this means that this change will not break component guides for applications regardless of whether they use individual css loading or not.Having said that, if an application is still using individual css loading and has its own components, those components will not render properly in the component guide (because their CSS won't load). The fix for this is either to add the application component stylesheets in somehow or switch to not using individual css loading (which we are currently moving towards for all applications).
Thanks to @MartinJJones for pairing on this.
Why
We've disabled the individual component css loading in a couple of applications, which has broken the component guide for those applications.
Relates to #5074
Visual Changes
None.
https://gov-uk.atlassian.net/jira/software/c/projects/PNP/boards/1356?selectedIssue=PNP-9612