diff --git a/releases.yml b/releases.yml index c7134268e..1251263a1 100644 --- a/releases.yml +++ b/releases.yml @@ -1,9 +1,9 @@ - version: 4.19.0 features: - component: List - url: /docs/patterns/lists#horizontal-new + url: /docs/patterns/lists#horizontal-section-new status: New - notes: We've introduced the .p-list--horizontal list variant. + notes: We've introduced the .p-list--horizontal-section list variant. - version: 4.18.0 features: - component: Quote wrapper diff --git a/scss/_base_placeholders.scss b/scss/_base_placeholders.scss index be2a86404..f7d91a221 100644 --- a/scss/_base_placeholders.scss +++ b/scss/_base_placeholders.scss @@ -67,17 +67,6 @@ padding-left: 0; } - %vf-list-with-state-icons { - @extend %vf-list; - - .p-list__item { - &.is-ticked::before, - &.is-crossed::before { - top: $spv--medium; - } - } - } - // Bars and borders %vf-pseudo-border { background-color: $colors--theme--border-default; diff --git a/scss/_patterns_lists.scss b/scss/_patterns_lists.scss index 7765f41ac..7499eedd0 100644 --- a/scss/_patterns_lists.scss +++ b/scss/_patterns_lists.scss @@ -134,6 +134,13 @@ $list-step-bullet-margin: $sph--x-large; } } + %vf-list-item-with-divisor-common-properties { + box-shadow: inset 0px 1px 0px 0px $colors--theme--border-low-contrast; + margin: 0; + padding-bottom: $sph--large; + padding-top: $sph--small; + } + %vf-list-item-bullet { &::before { color: $colors--theme--text-default; @@ -149,6 +156,7 @@ $list-step-bullet-margin: $sph--x-large; position: relative; > .p-list--divided, + > .p-list--horizontal-section, > .p-list { margin-left: 0; } @@ -161,10 +169,7 @@ $list-step-bullet-margin: $sph--x-large; } @mixin vf-list-item-divided { - box-shadow: inset 0px 1px 0px 0px $colors--theme--border-low-contrast; - margin: 0; - padding-bottom: $sph--large; - padding-top: $sph--small; + @extend %vf-list-item-with-divisor-common-properties; &:first-child { box-shadow: none; @@ -175,6 +180,18 @@ $list-step-bullet-margin: $sph--x-large; } } +@mixin vf-list-item-horizontal-section { + @extend %vf-list-item-with-divisor-common-properties; +} + +// Offset a list item icon (tick or cross) away from the divisor above it +@mixin vf-list-item-icon-divisor-offset { + &.is-ticked::before, + &.is-crossed::before { + top: $spv--medium; + } +} + // Mixin for inline list items @mixin vf-inline-list-item { display: inline; @@ -199,14 +216,15 @@ $list-step-bullet-margin: $sph--x-large; } } -@mixin vf-p-list-horizontal { - .p-list--horizontal { - @extend %vf-list-with-state-icons; +@mixin vf-p-list-horizontal-section { + .p-list--horizontal-section { @extend %vf-grid-row; + @extend %vf-list; .p-list__item { @extend %vf-list-item; - border-top: $border; + @include vf-list-item-icon-divisor-offset; + @include vf-list-item-horizontal-section; grid-column-end: span $grid-8-columns-small; @@ -219,7 +237,7 @@ $list-step-bullet-margin: $sph--x-large; } } } - .p-list--horizontal.is-3-cols-on-large { + .p-list--horizontal-section.is-25-75 { .p-list__item { // Skip the first two columns on large @media (min-width: $threshold-6-12-col) { @@ -240,11 +258,12 @@ $list-step-bullet-margin: $sph--x-large; // A list with separators between items @mixin vf-p-list-divided { .p-list--divided { - @extend %vf-list-with-state-icons; + @extend %vf-list; .p-list__item { @extend %vf-list-item; @include vf-list-item-divided; + @include vf-list-item-icon-divisor-offset; } & & { @@ -259,7 +278,8 @@ $list-step-bullet-margin: $sph--x-large; } // stylelint-disable selector-max-type -- we want to target ordered lists - ol.p-list--divided { + ol.p-list--divided, + ol.p-list--horizontal-section { counter-reset: p-list-divided-counter; list-style: none; @@ -522,7 +542,7 @@ $list-step-bullet-margin: $sph--x-large; @include vf-p-list-placeholders; @include vf-p-list; - @include vf-p-list-horizontal; + @include vf-p-list-horizontal-section; @include vf-p-list-divided; @include vf-p-list-item-state; @include vf-p-inline-list; diff --git a/templates/docs/examples/patterns/lists/_list-horizontal-section-example.jinja b/templates/docs/examples/patterns/lists/_list-horizontal-section-example.jinja new file mode 100644 index 000000000..44b09bd1a --- /dev/null +++ b/templates/docs/examples/patterns/lists/_list-horizontal-section-example.jinja @@ -0,0 +1,45 @@ +{% macro list_horizontal_section_example(list_item_style="", layout_variant_class="") %} + {% set list_item_style = list_item_style | trim %} + {% set layout_variant_class = layout_variant_class | trim %} + + {% set list_classes = "p-list--horizontal-section" %} + {% if layout_variant_class | length > 0 %} + {% set list_classes = list_classes + " " + layout_variant_class %} + {% endif %} + + {% set list_tag = "ul" %} + {% if list_item_style == "ordered" %} + {% set list_tag = "ol" %} + {% set list_item_style = "" %} + {% endif %} + + {% set list_item_classes = "p-list__item" %} + {% if list_item_style | length > 0 %} + {% set list_item_classes = list_item_classes + " " + list_item_style %} + {% endif %} + + <{{ list_tag }} class="{{ list_classes }}"> +
  • + 10 year security maintenance and CVE Patching +
  • +
  • + Kernel Livepatch for 24/7 patching with no downtime +
  • +
  • + Expanded security for infrastructure and applications +
  • +
  • + FIPS 140-2 cryptographic modules certified by NIST +
  • +
  • + Common Criteria EAL2: ISO/IEC IS 15408 validated by CSEC +
  • +
  • + DISA/STIG hardening for DoD + compliance +
  • +
  • + CIS profiles for cyber defence and malware prevention +
  • + +{% endmacro %} \ No newline at end of file diff --git a/templates/docs/examples/patterns/lists/combined.html b/templates/docs/examples/patterns/lists/combined.html index a3f919afc..7ef2573f6 100644 --- a/templates/docs/examples/patterns/lists/combined.html +++ b/templates/docs/examples/patterns/lists/combined.html @@ -26,7 +26,13 @@
    {% include 'docs/examples/patterns/lists/lists-stepped-heading-classes.html' %}
    {% include 'docs/examples/patterns/lists/lists-stepped-headings.html' %}
    {% include 'docs/examples/patterns/lists/lists-stepped-without-headings.html' %}
    -
    {% include 'docs/examples/patterns/lists/lists-horizontal-responsive.html' %}
    -
    {% include 'docs/examples/patterns/lists/lists-horizontal-3-cols-on-large-responsive.html' %}
    +
    {% include 'docs/examples/patterns/lists/lists-horizontal-section-responsive-bulleted.html' %}
    +
    {% include 'docs/examples/patterns/lists/lists-horizontal-section-responsive-crossed.html' %}
    +
    {% include 'docs/examples/patterns/lists/lists-horizontal-section-responsive-ordered.html' %}
    +
    {% include 'docs/examples/patterns/lists/lists-horizontal-section-responsive-ticked.html' %}
    +
    {% include 'docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-bulleted.html' %}
    +
    {% include 'docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-crossed.html' %}
    +
    {% include 'docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-ordered.html' %}
    +
    {% include 'docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-ticked.html' %}
    {% endwith %} {% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-3-cols-on-large-responsive.html b/templates/docs/examples/patterns/lists/lists-horizontal-3-cols-on-large-responsive.html deleted file mode 100644 index 98cebbf4b..000000000 --- a/templates/docs/examples/patterns/lists/lists-horizontal-3-cols-on-large-responsive.html +++ /dev/null @@ -1,44 +0,0 @@ -{% extends "_layouts/examples.html" %} -{% block title %}Lists / Horizontal / 3 columns on large{% endblock %} - -{% block standalone_css %}patterns_lists{% endblock %} - -{% block content %} -

    What's inside SQL Server on Ubuntu Pro?

    - -{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-responsive.html b/templates/docs/examples/patterns/lists/lists-horizontal-responsive.html deleted file mode 100644 index f8cd30872..000000000 --- a/templates/docs/examples/patterns/lists/lists-horizontal-responsive.html +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "_layouts/examples.html" %} -{% block title %}Lists / Horizontal / 4 columns on large{% endblock %} - -{% block standalone_css %}patterns_lists{% endblock %} - -{% block content %} - -{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-bulleted.html b/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-bulleted.html new file mode 100644 index 000000000..66298d651 --- /dev/null +++ b/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-bulleted.html @@ -0,0 +1,9 @@ +{% extends "_layouts/examples.html" %} +{% block title %}Lists / Horizontal section / 25/75 / Bulleted{% endblock %} +{% from "docs/examples/patterns/lists/_list-horizontal-section-example.jinja" import list_horizontal_section_example %} + +{% block standalone_css %}patterns_lists{% endblock %} + +{% block content %} +{{ list_horizontal_section_example('has-bullet', 'is-25-75') }} +{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-crossed.html b/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-crossed.html new file mode 100644 index 000000000..2951e3bfa --- /dev/null +++ b/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-crossed.html @@ -0,0 +1,9 @@ +{% extends "_layouts/examples.html" %} +{% block title %}Lists / Horizontal section / 25/75 / Crossed{% endblock %} +{% from "docs/examples/patterns/lists/_list-horizontal-section-example.jinja" import list_horizontal_section_example %} + +{% block standalone_css %}patterns_lists{% endblock %} + +{% block content %} +{{ list_horizontal_section_example('is-crossed', 'is-25-75') }} +{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-ordered.html b/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-ordered.html new file mode 100644 index 000000000..02d124d21 --- /dev/null +++ b/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-ordered.html @@ -0,0 +1,9 @@ +{% extends "_layouts/examples.html" %} +{% block title %}Lists / Horizontal section / 25/75 / Ordered{% endblock %} +{% from "docs/examples/patterns/lists/_list-horizontal-section-example.jinja" import list_horizontal_section_example %} + +{% block standalone_css %}patterns_lists{% endblock %} + +{% block content %} +{{ list_horizontal_section_example('ordered', 'is-25-75') }} +{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-ticked.html b/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-ticked.html new file mode 100644 index 000000000..0c3292349 --- /dev/null +++ b/templates/docs/examples/patterns/lists/lists-horizontal-section-25-75-responsive-ticked.html @@ -0,0 +1,9 @@ +{% extends "_layouts/examples.html" %} +{% block title %}Lists / Horizontal section / 25/75 / Ticked{% endblock %} +{% from "docs/examples/patterns/lists/_list-horizontal-section-example.jinja" import list_horizontal_section_example %} + +{% block standalone_css %}patterns_lists{% endblock %} + +{% block content %} +{{ list_horizontal_section_example('is-ticked', 'is-25-75') }} +{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-bulleted.html b/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-bulleted.html new file mode 100644 index 000000000..655be9dc2 --- /dev/null +++ b/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-bulleted.html @@ -0,0 +1,9 @@ +{% extends "_layouts/examples.html" %} +{% block title %}Lists / Horizontal section / Bulleted{% endblock %} +{% from "docs/examples/patterns/lists/_list-horizontal-section-example.jinja" import list_horizontal_section_example %} + +{% block standalone_css %}patterns_lists{% endblock %} + +{% block content %} +{{ list_horizontal_section_example('has-bullet') }} +{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-crossed.html b/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-crossed.html new file mode 100644 index 000000000..442ee9141 --- /dev/null +++ b/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-crossed.html @@ -0,0 +1,9 @@ +{% extends "_layouts/examples.html" %} +{% block title %}Lists / Horizontal section / Crossed{% endblock %} +{% from "docs/examples/patterns/lists/_list-horizontal-section-example.jinja" import list_horizontal_section_example %} + +{% block standalone_css %}patterns_lists{% endblock %} + +{% block content %} +{{ list_horizontal_section_example('is-crossed') }} +{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-ordered.html b/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-ordered.html new file mode 100644 index 000000000..ffaf76f81 --- /dev/null +++ b/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-ordered.html @@ -0,0 +1,9 @@ +{% extends "_layouts/examples.html" %} +{% block title %}Lists / Horizontal section / Ordered{% endblock %} +{% from "docs/examples/patterns/lists/_list-horizontal-section-example.jinja" import list_horizontal_section_example %} + +{% block standalone_css %}patterns_lists{% endblock %} + +{% block content %} +{{ list_horizontal_section_example('ordered') }} +{% endblock %} diff --git a/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-ticked.html b/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-ticked.html new file mode 100644 index 000000000..fac62b93a --- /dev/null +++ b/templates/docs/examples/patterns/lists/lists-horizontal-section-responsive-ticked.html @@ -0,0 +1,9 @@ +{% extends "_layouts/examples.html" %} +{% block title %}Lists / Horizontal section / Ticked{% endblock %} +{% from "docs/examples/patterns/lists/_list-horizontal-section-example.jinja" import list_horizontal_section_example %} + +{% block standalone_css %}patterns_lists{% endblock %} + +{% block content %} +{{ list_horizontal_section_example('is-ticked') }} +{% endblock %} diff --git a/templates/docs/patterns/lists/index.md b/templates/docs/patterns/lists/index.md index c83cb4fac..ae4dff941 100644 --- a/templates/docs/patterns/lists/index.md +++ b/templates/docs/patterns/lists/index.md @@ -163,21 +163,21 @@ If you wish to split the items in a list into two columns above `$breakpoint-sma View example of the patterns list split -## Horizontal {{ status("new") }} +## Horizontal section {{ status("new") }} -To display a list of items that flow horizontally in a grid, use `.p-list--horizontal`. +To display a list of items that flow horizontally in a grid, use `.p-list--horizontal-section`. By default, the horizontal splits items 25/25/25/25 on large, 50/50 on medium and 100% on small screens. -
    +
    View example of the default horizontal list pattern
    -You can also add the `.is-3-cols-on-large` modifier to reserve 25% space at the start of the list and place the remaining items in the remaining 75% space. +You can also add the `.is-25-75` modifier to reserve 25% space at the start of the list and place the remaining items in the remaining 75% space. This is especially effective when a section heading precedes the list. -
    -View example of the horizontal list pattern with 3 columns on large + ## Related components