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

Adjust nested list spacing #961

Merged
merged 3 commits into from
Jun 10, 2024
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
7 changes: 6 additions & 1 deletion app/pages/examples.njk
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
<li><a href="../components/warning-callout/index.html">Warning callout</a></li>
<li><a href="../components/warning-callout/custom-heading.html">Warning callout with custom heading</a></li>
</ul>

<h2>Styles</h2>
<ul class="nhsuk-list">
<li><a href="../styles/lists.html">Lists</a></li>
</ul>
{% endblock %}

{% block footer %}
Expand Down Expand Up @@ -156,4 +161,4 @@
]
})}}

{% endblock %}
{% endblock %}
101 changes: 101 additions & 0 deletions app/styles/lists.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{% set title = 'Lists' %}

{% extends 'page.njk' %}

{% block header %}
{{ super() }}
{% endblock %}

{% block breadcrumb %}
{{ breadcrumb({
items: [
{
href: "../../",
text: "NHS.UK frontend"
},
{
href: "../pages/examples.html",
text: "Examples"
}
]
}) }}
{% endblock %}

{% block content %}

<h1 class="nhsuk-heading-xl">Lists</h1>

<h2 class="nhsuk-heading-m">Plain list</h2>

<ul class="nhsuk-list">
<li><a href="#">Money, work and benefits</a></li>
<li><a href="#">Care after a hospital stay</a></li>
<li><a href="#">Support and benefits for carers</a></li>
</ul>

<h2 class="nhsuk-heading-m">Bulleted list</h2>

<ul class="nhsuk-list nhsuk-list--bullet">
<li>tiredness and lack of energy</li>
<li>shortness of breath</li>
<li>noticeable heartbeats (heart palpitations)</li>
<li>pale skin</li>
</ul>

<h2 class="nhsuk-heading-m">Numbered list</h2>

<ol class="nhsuk-list nhsuk-list--number">
<li>Dissolve half a teaspoon of salt in a glass of warm water.</li>
<li>Gargle with the solution then spit it out – don't swallow it.</li>
<li>Repeat as often as you like.</li>
</ol>

<h2 class="nhsuk-heading-m">Bulleted list with nested bulleted list</h2>

<ul class="nhsuk-list nhsuk-list--bullet">
<li>Accessibility</li>
<li>Policies
<ul class="nhsuk-list nhsuk-list--bullet">
<li>Cookies</li>
<li>Terms and conditions</li>
<li>Privacy policy</li>
</ul>
</li>
<li>Sitemap</li>
</ul>

<h2 class="nhsuk-heading-m">Numbered list with nested numbered list</h2>

<ul class="nhsuk-list nhsuk-list--number">
<li>Accessibility</li>
<li>Policies
<ul class="nhsuk-list nhsuk-list--number">
<li>Cookies</li>
<li>Terms and conditions</li>
<li>Privacy policy</li>
</ul>
</li>
<li>Sitemap</li>
</ul>

<h2 class="nhsuk-heading-m">Bulleted list with 2 nested lists</h2>

<ul class="nhsuk-list nhsuk-list--bullet">
<li>Service standard</li>
<li>Design system
<ul class="nhsuk-list nhsuk-list--bullet">
<li>Styles</li>
<li>Components
<ul class="nhsuk-list nhsuk-list--bullet">
<li>Buttons</li>
<li>Checkboxes</li>
</ul>
</li>
<li>Patterns</li>
</ul>
</li>
<li>Content guide</li>
</ul>


{% endblock %}
6 changes: 6 additions & 0 deletions packages/core/styles/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
list-style-type: none;
margin-top: 0;
padding-left: 0;

// Add a top margin and remove bottom margin for nested lists
%nhsuk-list {
@include nhsuk-responsive-margin(2, "top");
margin-bottom: 0;
}
}

%nhsuk-list > li {
Expand Down
Loading