From bae04590522676397b3a28d2ea6ab694dac45103 Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Sat, 8 Jun 2024 22:32:46 +0100 Subject: [PATCH 1/2] Adjust nested list spacing Add examples of nested lists --- app/pages/examples.njk | 7 ++- app/styles/lists.njk | 101 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 app/styles/lists.njk diff --git a/app/pages/examples.njk b/app/pages/examples.njk index c8093d5c1..6473c4dd4 100644 --- a/app/pages/examples.njk +++ b/app/pages/examples.njk @@ -127,6 +127,11 @@
  • Warning callout
  • Warning callout with custom heading
  • + +

    Styles

    + {% endblock %} {% block footer %} @@ -156,4 +161,4 @@ ] })}} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/styles/lists.njk b/app/styles/lists.njk new file mode 100644 index 000000000..cbe0590fa --- /dev/null +++ b/app/styles/lists.njk @@ -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 %} + +

    Lists

    + +

    Plain list

    + + + +

    Bulleted list

    + + + +

    Numbered list

    + +
      +
    1. Dissolve half a teaspoon of salt in a glass of warm water.
    2. +
    3. Gargle with the solution then spit it out – don't swallow it.
    4. +
    5. Repeat as often as you like.
    6. +
    + +

    Bulleted list with nested bulleted list

    + + + +

    Numbered list with nested numbered list

    + + + +

    Bulleted list with 2 nested lists

    + + + + +{% endblock %} From be24ddf64f66ccc2aef1c9e2ee53d92cb063bbcf Mon Sep 17 00:00:00 2001 From: Frankie Roberto Date: Sat, 8 Jun 2024 22:32:59 +0100 Subject: [PATCH 2/2] Adjust vertical spacing for nested lists --- packages/core/styles/_lists.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/core/styles/_lists.scss b/packages/core/styles/_lists.scss index eb52b3e07..07556cccc 100644 --- a/packages/core/styles/_lists.scss +++ b/packages/core/styles/_lists.scss @@ -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 {