Skip to content

Commit

Permalink
Merge branch 'main' into add-summary-list-row-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto authored Sep 10, 2024
2 parents f26dab7 + 5e44a2e commit 855d577
Show file tree
Hide file tree
Showing 183 changed files with 116 additions and 70 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
- Fix Sass deprecation on `mix` function (passing a number without unit) ([PR 995](https://github.com/nhsuk/nhsuk-frontend/pull/995))
- Add nhsukAttributes macro, copied from GOV.UK ([PR 998](https://github.com/nhsuk/nhsuk-frontend/pull/998))
- Fix missing classes option for summary list rows ([PR 1007](https://github.com/nhsuk/nhsuk-frontend/pull/1007))
- Add support for inline conditions on summary list rows ([PR 1008](https://github.com/nhsuk/nhsuk-frontend/pull/1008))
- Change "Contact us" in the footer link examples to "Give us feedback" ([PR 972](https://github.com/nhsuk/nhsuk-frontend/pull/972))
- Adjusted default spacing of back link component ([PR 964](https://github.com/nhsuk/nhsuk-frontend/pull/964))
- Reduce main wrapper padding on mobile ([PR 1003](https://github.com/nhsuk/nhsuk-frontend/pull/1003))

## 8.3.0 - 24 July 2024

Expand Down
3 changes: 1 addition & 2 deletions app/_templates/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@

{% block body %}

{% block breadcrumb %}{% endblock %}

<div class="nhsuk-width-container">
{% block beforeContent %}{% endblock %}
<main class="nhsuk-main-wrapper" id="maincontent">

<div class="nhsuk-grid-row">
Expand Down
2 changes: 1 addition & 1 deletion app/components/all.njk
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}}
{% endblock %}

{% block breadcrumb %}
{% block beforeContent %}
{{ breadcrumb({
items: [
{
Expand Down
2 changes: 1 addition & 1 deletion app/components/back-link/button.njk
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
</main>
</div>

{% endblock %}
{% endblock %}
8 changes: 6 additions & 2 deletions app/components/back-link/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
{{ backLink({
"href": "#",
"text": "Go back"
href: "#",
text: "Go back"
}) }}
</div>
</div>

</main>
</div>

{% endblock %}

{% block heading %}
<h1 class="govuk-heading-l">Page title</h1>
{% endblock %}
58 changes: 36 additions & 22 deletions app/components/breadcrumb/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,41 @@

{% block body %}

{{ breadcrumb({
items: [
{
href: "#",
text: "Level one",
attributes: {lang: "en"}
},
{
href: "#",
text: "Level two"
},
{
href: "#",
text: "Level three",
attributes: {lang: "en"}
}
],
href: "#",
text: "Level four",
classes: "example-class-one example-class-two",
attributes: {lang: "en"}
}) }}
<div class="nhsuk-width-container">
<main class="nhsuk-main-wrapper" id="maincontent">

<div class="nhsuk-grid-row">
<div class="nhsuk-grid-column-two-thirds">
{{ breadcrumb({
items: [
{
href: "#",
text: "Level one",
attributes: {lang: "en"}
},
{
href: "#",
text: "Level two"
},
{
href: "#",
text: "Level three",
attributes: {lang: "en"}
}
],
href: "#",
text: "Level four",
classes: "example-class-one example-class-two",
attributes: {lang: "en"}
}) }}
</div>
</div>

</main>
</div>

{% endblock %}

{% block heading %}
<h1 class="govuk-heading-l">Page title</h1>
{% endblock %}
2 changes: 1 addition & 1 deletion app/pages/about.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{ super() }}
{% endblock %}

{% block breadcrumb %}
{% block beforeContent %}
{{ breadcrumb({
items: [
{
Expand Down
2 changes: 1 addition & 1 deletion app/pages/examples.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{ super() }}
{% endblock %}

{% block breadcrumb %}
{% block beforeContent %}
{{ breadcrumb({
items: [
{
Expand Down
2 changes: 1 addition & 1 deletion app/pages/install.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{ super() }}
{% endblock %}

{% block breadcrumb %}
{% block beforeContent %}
{{ breadcrumb({
items: [
{
Expand Down
2 changes: 1 addition & 1 deletion app/styles/lists.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ super() }}
{% endblock %}

{% block breadcrumb %}
{% block beforeContent %}
{{ breadcrumb({
items: [
{
Expand Down
12 changes: 11 additions & 1 deletion packages/components/back-link/_back-link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
* 1. Allow space for the arrow.
* 2. Align the icon with the start of the back link.
* 3. Align the icon with the middle of the text.
* 4. Make back link same height as breadcrumb.
*/

.nhsuk-back-link {
margin-bottom: nhsuk-spacing(3);
margin-top: nhsuk-spacing(3);
line-height: 1; /* 4 */

@include mq($from: tablet) {
margin-top: nhsuk-spacing(4);
}
}

.nhsuk-back-link__link {
Expand All @@ -30,6 +36,10 @@
position: absolute;
top: -1px; /* 3 */
width: 24px;

@include mq($from: tablet) {
top: 0; /* 3 */
}
}

&:visited {
Expand Down
15 changes: 7 additions & 8 deletions packages/components/breadcrumb/_breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

/**
* 1. Hide the breadcrumb on print stylesheets.
* 2. Bespoke spacing numbers used as there is no 20px
* spacing mapped in settings/spacing.
* 3. Don't show the full breadcrumb below tablet size.
* 4. Typography sizing mixin, see core/tools/_typography
* 5. and core/settings/_typography for size maps.
Expand All @@ -14,12 +12,10 @@

.nhsuk-breadcrumb {
@include print-hide(); /* [1] */
margin-top: nhsuk-spacing(3);

padding-bottom: nhsuk-spacing(3);
padding-top: 20px; /* [2] */

+ .nhsuk-width-container .nhsuk-main-wrapper {
padding-top: 0;
@include mq($from: tablet) {
margin-top: nhsuk-spacing(4);
}
}

Expand All @@ -28,6 +24,7 @@
display: none; /* [3] */
}

@include nhsuk-font(16); /* [4] */
list-style: none;
margin: 0;
padding: 0;
Expand Down Expand Up @@ -84,12 +81,14 @@
height: 18px;
left: 0;
position: absolute;
top: 0;
top: -1px;
width: 10px;
}
}

.nhsuk-breadcrumb__backlink {
text-decoration: none;

&:visited {
color: $nhsuk-link-color;

Expand Down
46 changes: 22 additions & 24 deletions packages/components/breadcrumb/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@

<nav class="nhsuk-breadcrumb{% if params.classes %} {{ params.classes }}{% endif %}" aria-label="Breadcrumb"
{{- nhsukAttributes(params.attributes) }}>
<div class="nhsuk-width-container">
<ol class="nhsuk-breadcrumb__list">
{%- for item in params.items %}
{%- if item.href %}
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link" href="{{ item.href }}" {{- nhsukAttributes(item.attributes) }}>{{ item.text }}</a>{% if not loop.last %}{% endif %}</li>
{%- endif -%}
{% endfor %}
{% if params.href %}
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link" href="{{ params.href }}">{{ params.text}}</a></li>
{% set lastHref = params.href %}
{% set lastText = params.text %}
{% else %}
{% set lastItem = params.items | last%}
{% set lastHref = lastItem.href %}
{% set lastText = lastItem.text %}
{% endif %}
</ol>
<p class="nhsuk-breadcrumb__back">
<a class="nhsuk-breadcrumb__backlink" href="{{ lastHref }}" {{- nhsukAttributes(lastItem.attributes) }}>
<span class="nhsuk-u-visually-hidden">Back to &nbsp;</span>
{{ lastText }}
</a>
</p>
</div>
<ol class="nhsuk-breadcrumb__list">
{%- for item in params.items %}
{%- if item.href %}
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link" href="{{ item.href }}" {{- nhsukAttributes(item.attributes) }}>{{ item.text }}</a>{% if not loop.last %}{% endif %}</li>
{%- endif -%}
{% endfor %}
{% if params.href %}
<li class="nhsuk-breadcrumb__item"><a class="nhsuk-breadcrumb__link" href="{{ params.href }}">{{ params.text}}</a></li>
{% set lastHref = params.href %}
{% set lastText = params.text %}
{% else %}
{% set lastItem = params.items | last%}
{% set lastHref = lastItem.href %}
{% set lastText = lastItem.text %}
{% endif %}
</ol>
<p class="nhsuk-breadcrumb__back">
<a class="nhsuk-breadcrumb__backlink" href="{{ lastHref }}" {{- nhsukAttributes(lastItem.attributes) }}>
<span class="nhsuk-u-visually-hidden">Back to &nbsp;</span>
{{ lastText }}
</a>
</p>
</nav>
2 changes: 2 additions & 0 deletions packages/components/summary-list/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{% endmacro -%}
<dl class="nhsuk-summary-list {%- if params.classes %} {{ params.classes }}{% endif %}" {{- nhsukAttributes(params.attributes) }}>
{% for row in params.rows %}
{% if row %}
<div class="nhsuk-summary-list__row {%- if row.classes %} {{ row.classes }}{% endif %}">
<dt class="nhsuk-summary-list__key {%- if row.key.classes %} {{ row.key.classes }}{% endif %}">
{{ row.key.html | safe if row.key.html else row.key.text }}
Expand All @@ -33,5 +34,6 @@
</dd>
{% endif %}
</div>
{% endif %}
{% endfor %}
</dl>
26 changes: 21 additions & 5 deletions packages/core/objects/_main-wrapper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,44 @@
*/

@mixin govuk-main-wrapper {
@include nhsuk-responsive-padding(7, "top");
@include nhsuk-responsive-padding(7, "bottom");
@include top-and-bottom();
display: block; /* [1] */
padding-top: nhsuk-spacing(4);
padding-bottom: nhsuk-spacing(4);

@include mq($from: tablet) {
padding-top: nhsuk-spacing(7);
padding-bottom: nhsuk-spacing(7);
}
}

@mixin govuk-main-wrapper--l {
@include nhsuk-responsive-padding(8, "top");
padding-top: nhsuk-spacing(6);

@include mq($from: tablet) {
padding-top: nhsuk-spacing(8);
}
}

@mixin govuk-main-wrapper--s {
@include nhsuk-responsive-padding(5, "bottom");
@include nhsuk-responsive-padding(5, "top");
padding-top: nhsuk-spacing(3);
padding-bottom: nhsuk-spacing(3);

@include mq($from: tablet) {
padding-top: nhsuk-spacing(4);
padding-bottom: nhsuk-spacing(4);
}
}

@include govuk-exports("govuk/objects/main-wrapper") {
.nhsuk-main-wrapper {
@include govuk-main-wrapper;
}

.nhsuk-main-wrapper--l {
@include govuk-main-wrapper--l;
}

.nhsuk-main-wrapper--s {
@include govuk-main-wrapper--s;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 855d577

Please sign in to comment.