-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add custom css exclude list to Asset Helper #4656
Conversation
4be7861
to
23b3184
Compare
23b3184
to
39482d9
Compare
39482d9
to
de924eb
Compare
- Add a translation function that adds the required path to the list of components. - Make the method always use an exclusion array, which is set by another method to either an empty array or the static exclude array.
- We don't have explicit tests for when we've got exclude_css_from_static set and we're visiting the component guide. Add that test, and also replace the chained safe navigation operator with a guard clause (we might not get a request, but if we do get one, it will definitely be a request.
- this adds another option to the asset helper's css_exclude_list method - if a custom exclude list is set, return that if we're not in the component guide (ignoring the STATIC_STYLESHEET_LIST) - We want this for applications that don't use static, but will benefit from having a small number of hardcoded component styles in their application stylesheets (this is a stepping stone to getting back to a shared basic styles stylesheet without static).
- scenarios don't seem to reset config, so we also need to explicitly set this to nil in other tests
de924eb
to
e4ef91c
Compare
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.
Very nice work on this! I like the addition of the custom_css_exclude_list
feature, the refactored code and updated tests look good to me as well 👍
Looks like it needs a Changelog entry
Ah yeah, this is definitely not purely internal! Thanks, added! |
- This version has the custom_css_exclude_list feature (alphagov/govuk_publishing_components#4656) needed for the bundle css to work without individually loading stylesheets for the bundled components.
What
Add an option to supply a custom css exclude list - this is like the current list that excludes anything always supplied by static from the individual component support, but for non-static based apps, where they might as a stopgap want to provide their own application.css with a hardcoded list of styles to include, but that might not be the same list as static's list.
Also mild refactoring of the asset helper to improve test coverage.
Why
To support a bundled set of stylesheets for email-alert-frontend, as here: alphagov/email-alert-frontend#1890.
https://trello.com/c/O6JhukLu/487-remove-slimmer-email-alert-frontend
Visual Changes
None.