From 345dc8465b93b21838778269c7020577afafa8de Mon Sep 17 00:00:00 2001 From: Scott Williams <5209283+scott-williams-az@users.noreply.github.com> Date: Tue, 29 Apr 2025 10:54:34 -0700 Subject: [PATCH 1/2] fix(unity-bootstrap-theme): standardize all list types margins --- .../src/scss/extends/_list.scss | 28 ++++++++----------- .../src/components/List/List.stories.tsx | 22 +++++++++++++-- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/packages/unity-bootstrap-theme/src/scss/extends/_list.scss b/packages/unity-bootstrap-theme/src/scss/extends/_list.scss index 760c3f3381..81cc1fb94c 100644 --- a/packages/unity-bootstrap-theme/src/scss/extends/_list.scss +++ b/packages/unity-bootstrap-theme/src/scss/extends/_list.scss @@ -5,7 +5,7 @@ --list-padding-top: 0; --list-padding-right: 0; --list-padding-bottom: 3rem; - --list-padding-left: 2rem; + --list-padding-left: 3rem; --list-list-style: none; --li-before-line-height: 1.5rem; @@ -32,6 +32,10 @@ color: var(--li-before-color); background-color: var(--li-before-background-color); line-height: var(--li-before-line-height); + left: -3rem; + text-align: right; + position: absolute; + width: 2rem; } } } @@ -44,7 +48,6 @@ ul.uds-list ul { --list-padding-top: 1rem; --list-padding-right: 0; --list-padding-bottom: 0; - --list-padding-left: 1.5rem; --list-list-style: none; } @@ -101,8 +104,6 @@ ul.uds-list, & > li:before{ --li-before-font-size: 2rem; vertical-align: middle; - padding-right: 1.25rem; // Magic number.; - margin-left: -2rem; } } @@ -162,7 +163,6 @@ ul.uds-list { &.fa-ul { @include uds-list-spacing; - --list-padding-left: 2.25rem; // Avoid icon clipping. margin-left: 0rem; margin-bottom: 0rem; li .fa-li { @@ -197,17 +197,10 @@ ol.uds-list, & > li:before { --li-before-font-size: 1rem; counter-increment: listcounter; - padding-right: .75rem; - margin-left: -1.9rem; - } - - // Adjust indent for double digits. - li:nth-of-type(9) ~ li:before { - margin-left: -2.4rem; - } - // Adjust indent for triple digits. - li:nth-of-type(99) ~ li:before { - margin-left: -2.9rem; + left: -3rem; + text-align: right; + position: absolute; + width: 2rem; } // Step List styles @@ -240,6 +233,9 @@ ol.uds-list, margin-right: 2rem; margin-left: -4.5rem; font-weight: bold; + position: absolute; + left: auto; + width: auto; } } diff --git a/packages/unity-react-core/src/components/List/List.stories.tsx b/packages/unity-react-core/src/components/List/List.stories.tsx index e53dbfa8b1..5365f01e5f 100644 --- a/packages/unity-react-core/src/components/List/List.stories.tsx +++ b/packages/unity-react-core/src/components/List/List.stories.tsx @@ -10,11 +10,29 @@ const decorator = (story:StoryFn, context: StoryContext) => export default { title: "Components/List", component: List, + args: { + multiplier: 1, + }, + argTypes: { + multiplier: { + name: "Multiplier", + description: "Storybook control - Number of times to repeat the items.", + control: { + type: "number", + min: 1, + max: 111, + step: 1, + }, + }, + }, decorators: [decorator] }; -const listTemplate = (args: ListProps) => { - return +const listTemplate = (args: ListProps & { multiplier: number }) => { + const multiplier = args.multiplier > 0 ? args.multiplier : 1; + return ( + + ); }; export const UnorderedList = { From 9cccf5eb25a481156bf2c74912ee049ac5110992 Mon Sep 17 00:00:00 2001 From: Scott Williams <5209283+scott-williams-az@users.noreply.github.com> Date: Mon, 5 May 2025 10:31:35 -0700 Subject: [PATCH 2/2] fix(unity-bootstrap-theme): steplist adjust circle to be more rounded --- packages/unity-bootstrap-theme/src/scss/extends/_list.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/unity-bootstrap-theme/src/scss/extends/_list.scss b/packages/unity-bootstrap-theme/src/scss/extends/_list.scss index 81cc1fb94c..6b93740c58 100644 --- a/packages/unity-bootstrap-theme/src/scss/extends/_list.scss +++ b/packages/unity-bootstrap-theme/src/scss/extends/_list.scss @@ -229,7 +229,7 @@ ol.uds-list, --li-before-color: #{$uds-color-base-gray-1}; --li-before-font-size: 1.25rem; border-radius: 50rem; - padding: 0.5rem 0.8rem; // Following is more true to XD step circle sizing, but looks less rounded: padding: 0.4rem 0.6rem; + padding: 0.4rem 0.8rem; margin-right: 2rem; margin-left: -4.5rem; font-weight: bold;