diff --git a/CHANGELOG.md b/CHANGELOG.md index e4cd81616e..d93486a93d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Note: We're not following semantic versioning yet, we are going to talk about th ## Unreleased +Breaking changes: + +- The error summary component now has a default bottom margin + (PR [#583](https://github.com/alphagov/govuk-frontend/pull/583)) + Internal: - Update pre-release step to check for new components diff --git a/app/views/examples/error-summary-with-messages/index.njk b/app/views/examples/error-summary-with-messages/index.njk new file mode 100644 index 0000000000..0b7b624e4f --- /dev/null +++ b/app/views/examples/error-summary-with-messages/index.njk @@ -0,0 +1,79 @@ +{% from "back-link/macro.njk" import govukBackLink %} +{% from "button/macro.njk" import govukButton %} +{% from "date-input/macro.njk" import govukDateInput %} +{% from "error-summary/macro.njk" import govukErrorSummary %} +{% from "input/macro.njk" import govukInput %} + +{% extends "layout.njk" %} + +{% block content %} + +{{ govukBackLink({ + "href": "/", + "text": "Back" +}) }} + +
+ +
+ + {{ govukErrorSummary({ + "titleText": "Message to alert the user to a problem goes here", + "descriptionText": "Optional description of the errors and how to correct them", + "classes": "optional-extra-class", + "errorList": [ + { + "text": "Descriptive link to the question with an error", + "href": "#example-error-1" + }, + { + "text": "Descriptive link to the question with an error", + "href": "#example-error-1" + } + ] + }) }} + +

Passport details

+ + {{ govukInput({ + label: { + "html": '

Passport number

', + "hintText": "For example, 502135326" + }, + id: "passport-number", + name: "passport-number", + errorMessage: { + "text": "You must provide your passport number" + } + }) }} + + {{ govukDateInput({ + fieldset: { + legendHtml: '

Expiry date

', + legendHintText: 'For example, 08 2014' + }, + id: 'expiry', + name: 'expiry', + items:[ + { + name: 'month' + }, + { + name: 'year' + } + ], + errorMessage: { + "text": "You must provide your expiry date" + } + }) + }} + + {{ govukButton({ + "text": "Continue" + }) }} + +
+ +
+ +{% endblock %} diff --git a/app/views/examples/error-summary-with-one-thing-per-page/index.njk b/app/views/examples/error-summary-with-one-thing-per-page/index.njk new file mode 100644 index 0000000000..50c58ad71b --- /dev/null +++ b/app/views/examples/error-summary-with-one-thing-per-page/index.njk @@ -0,0 +1,67 @@ +{% from "back-link/macro.njk" import govukBackLink %} +{% from "button/macro.njk" import govukButton %} +{% from "date-input/macro.njk" import govukDateInput %} +{% from "error-summary/macro.njk" import govukErrorSummary %} + +{% extends "layout.njk" %} + +{% block content %} + +{{ govukBackLink({ + "href": "/", + "text": "Back" +}) }} + +
+ +
+ + {{ govukErrorSummary({ + "titleText": "Message to alert the user to a problem goes here", + "descriptionText": "Optional description of the errors and how to correct them", + "classes": "optional-extra-class", + "errorList": [ + { + "text": "Descriptive link to the question with an error", + "href": "#example-error-1" + }, + { + "text": "Descriptive link to the question with an error", + "href": "#example-error-1" + } + ] + }) }} + + {{ govukDateInput({ + fieldset: { + legendHtml: '

What is your date of birth?

', + legendHintText: 'For example, 31 3 1980' + }, + id: 'dob', + name: 'dob', + items:[ + { + name: 'day' + }, + { + name: 'month' + }, + { + name: 'year' + } + ], + errorMessage: { + text: "You must provide your date of birth" + } + }) + }} + + {{ govukButton({ + "text": "Continue" + }) }} + +
+ +
+ +{% endblock %} diff --git a/src/error-summary/_error-summary.scss b/src/error-summary/_error-summary.scss index c9bc1c6ca2..df38a8fd5b 100644 --- a/src/error-summary/_error-summary.scss +++ b/src/error-summary/_error-summary.scss @@ -5,6 +5,7 @@ .govuk-c-error-summary { @include govuk-text-colour; @include govuk-responsive-padding($govuk-spacing-responsive-4); + @include govuk-responsive-margin($govuk-spacing-responsive-8, "bottom"); @include govuk-focusable; border: $govuk-border-width-mobile solid $govuk-error-colour;