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 details script #610

Merged
merged 6 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/details/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ Find out when to use the Details component in your service in the [GOV.UK Design
"text": "We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post."
}) }}

### Details--expanded

[Preview the details--expanded example](http://govuk-frontend-review.herokuapp.com/components/details/expanded/preview)

#### Markup

<details id="help-with-nationality" class="govuk-c-details" open>
<summary class="govuk-c-details__summary">
<span class="govuk-c-details__summary-text">
Help with nationality
</span>
</summary>
<div class="govuk-c-details__text">
We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.
</div>
</details>

#### Macro

{{ govukDetails({
"id": "help-with-nationality",
"summaryText": "Help with nationality",
"text": "We need to know your nationality so we can work out which elections you’re entitled to vote in. If you can’t provide your nationality, you’ll have to send copies of identity documents through the post.",
"open": true
}) }}

### Details--with-html

[Preview the details--with-html example](http://govuk-frontend-review.herokuapp.com/components/details/with-html/preview)
Expand Down Expand Up @@ -164,6 +190,18 @@ If you are using Nunjucks,then macros take the following arguments

<tr class="govuk-c-table__row">

<th class="govuk-c-table__header" scope="row">id</th>

<td class="govuk-c-table__cell ">string</td>

<td class="govuk-c-table__cell ">No</td>

<td class="govuk-c-table__cell ">Optional id</td>

</tr>

<tr class="govuk-c-table__row">

<th class="govuk-c-table__header" scope="row">classes</th>

<td class="govuk-c-table__cell ">string</td>
Expand All @@ -176,6 +214,18 @@ If you are using Nunjucks,then macros take the following arguments

<tr class="govuk-c-table__row">

<th class="govuk-c-table__header" scope="row">open</th>

<td class="govuk-c-table__cell ">boolean</td>

<td class="govuk-c-table__cell ">No</td>

<td class="govuk-c-table__cell ">If true, details will be expanded.</td>

</tr>

<tr class="govuk-c-table__row">

<th class="govuk-c-table__header" scope="row">attributes</th>

<td class="govuk-c-table__cell ">object</td>
Expand Down
2 changes: 1 addition & 1 deletion src/details/_details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}

// Append our own open / closed marker using a pseudo-element
.govuk-c-details__summary::before {
.govuk-c-details__summary:before {
content: "";
position: absolute;

Expand Down
Loading