Skip to content
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 GOVUK Frontend details component #3209

Merged
merged 6 commits into from
Dec 16, 2019
Merged

Conversation

tombye
Copy link
Contributor

@tombye tombye commented Nov 29, 2019

This moves all macros for <details> tags in the app to use the GOVUK Frontend details component.

details_on_platform_admin

The <details> on the API integration page cannot use the new component:
details_on_api_page

It separates the content of its <summary> tag into text that has the 'link style' and text that doesn't. The GOVUK Frontend component doesn't support this at present so we have to cut-and-paste the HTML it produces instead.

@tombye
Copy link
Contributor Author

tombye commented Dec 3, 2019

Rebased this to sit it on top of the changes that removed the app/templates/vendor folder from the repo (see #3208 (review) for details of why).

Includes:

- in gulpfile.js:
  - add details macro to list of those copied from GOVUK Frontend
  - remove existing details polyfill
- convert all, but one, <details> tags to use GOVUK Frontend details component
- add jinja boolean filter to help setting 'open' attribute of <details> tags

Notes on the `<details>` not included in this:

The `<details>` used for notifications items on
the API integration page is not possible to
reproduce with the GOV.UK Frontend macro so I'm
splitting the resulting work out into it's own
commit.
  The GOV.UK Frontend details component macro
  wraps its `<summary>` text in a `<span>`.

  We put a `<h3>` in the `<summary>` (actually valid
  use, based on the spec) so this breaks when the
  `<span>` wraps it.

  This converts the existing `<details>` tag to use
  all the class names the macro creates, but with
  all the `<summary>` contents in the `<h3>`.

  Also adds font-smoothing to the messages on the
  API page. This was previously set globally for
  all fonts in the GOV.UK Template CSS but is now
  just set for the New Transport 'nta' font.
  Included because the messages use the monospace
  font so don't have it by default.
I moved the meta for each message into the
`<h3>` in each `<summary>` to make the heading
unique. This broke the test.
app/templates/views/platform-admin/index.html Outdated Show resolved Hide resolved
gulpfile.js Show resolved Hide resolved
@tombye tombye merged commit 60fe9d3 into master Dec 16, 2019
@tombye tombye deleted the add-govuk-frontend-details branch December 16, 2019 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants