-
Notifications
You must be signed in to change notification settings - Fork 21
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
Rework the way we include CSS & JS #571
Conversation
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.
Looks good thanks for carrying this through.
app/views/govuk_publishing_components/components/_layout_for_admin.html.erb
Show resolved
Hide resolved
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.
💯 This looks great!
I agree with @kevindew's suggestions, other than that can't wait to get it in.
7eaa4d7
to
3c25655
Compare
3c25655
to
1929d4d
Compare
We're using the tag component, but we've previously relied on the `govuk-frontend/all` import to import the CSS.
This is no longer needed, because all components are renderable in all contexts.
This imports the CSS that we need for the layout into the layout-for-admin component. This means that the `govuk-grid-*`, `govuk-link` and `govuk-heading` classes are available inside this component, but not outside. This means we can stop including all of govuk-frontend using `@import "govuk-frontend/all"`.
This removes the separate "admin_styles.css" file for the components. From now on the applications will have to have an `application.css` file with the correct component includes.
This component now has a class.
This removes the separate "admin_styles.js" file for the components. From now on the applications will have to have an `application.js` file with the correct component includes. Updated the installation instructions as well.
These files don't need to be available separately.
This was relying previously on the `govuk-frontend/all` import.
This is needed by content publisher to hide certain content.
The component guide already includes these.
1929d4d
to
03d7c66
Compare
This file is already required by `govuk_publishing_components/dependencies`.
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.
👏
* Add option to send the `user_organisation` in admin analytics component (PR #577) * Add a bottom margin to the error-alert component (PR #578) * Update the way we include Javascript and Stylesheets in the admin layout component. Make sure to follow the [installation instructions](docs/install-and-use.md) (PR #571) if your using the admin layout component. * Fix background colour for focused buttons (PR #579)
* Add option to send the `user_organisation` in admin analytics component (PR #577) * Add a bottom margin to the error-alert component (PR #578) * Update the way we include Javascript and Stylesheets in the admin layout component. Make sure to follow the [installation instructions](docs/install-and-use.md) (PR #571) if your using the admin layout component. * Fix background colour for focused buttons (PR #579)
This is another attempt at unfuzzing the way we include CSS & Javascript. This PR reduces it down to the following:
application.css
by convention). This means public and admin apps use the exact same mechanism to load the CSS.See this pull request on how to convert the application.