Skip to content

Conversation

@krisxcrash
Copy link
Contributor

@krisxcrash krisxcrash commented Oct 30, 2025

Description

This PR migrates from global <ul> styles to using the component adapter's UnorderedList component, improving consistency and customizability across the SDK.

JIRA Ticket: https://gustohq.atlassian.net/browse/GWS-5723

Changes Made

1. Removed Global <ul> Styles (src/styles/_Base.scss)

  • Removed global styling for <ul> elements that was applying margin: 0, display: flex, flex-direction: column, gap, and padding
  • This global styling is now handled by the UnorderedList component

2. Enhanced UnorderedList Component (src/components/Common/UI/List/List.module.scss)

  • Added flex layout properties to unordered lists: display: flex, flex-direction: column
  • Added consistent gap between list items: gap: toRem(12)
  • Added consistent left padding: padding: 0 0 0 toRem(24)

3. Updated RequirementsList Component

TypeScript (src/components/Common/RequirementsList/RequirementsList.tsx):

  • Replaced native <ul> and <li> elements with Components.UnorderedList
  • Changed list items from <li> to <div> (since UnorderedList wraps items in <li> automatically)

Styles (src/components/Common/RequirementsList/RequirementsList.module.scss):

  • Added overrides to remove default list styling: list-style-type: none !important, padding: 0 !important, gap: 0 !important
  • Moved the dotted connector line pseudo-element from .listItem:not(:last-child)::after to :global(li):not(:last-child) .listItem::after to accommodate the new HTML structure
  • This ensures the vertical dotted lines still appear between requirement items

4. Updated Employee/Landing Component (src/components/Employee/Landing/Landing.tsx)

  • Replaced native <ul> and <li> elements with Components.UnorderedList
  • Simplified list rendering by passing an array of translated strings directly to the items prop

5. Updated Welcome Stories (.ladle/Welcome.stories.tsx)

  • Migrated list in Introduction story to use Components.UnorderedList
  • Maintained existing list item structure and content

Testing

  • Verified RequirementsList maintains its visual appearance (numbered icons, checkmarks, dotted connectors)
  • Verified Employee/Landing list displays correctly
  • No linter errors

Screenshots

image image

@krisxcrash krisxcrash self-assigned this Oct 30, 2025
Copy link
Contributor

@jeffredodd jeffredodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small things, otherwise its looking good!

</ul>
<Components.UnorderedList
items={[
<>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So a few things, if you look at the UnorderedList component, you'll see it actually provides the LI's. So we just need to provide the text here since the component will render this on each item.

          <li key={key} className={styles.item}>
            {item}
          </li>
        )```

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me fix that!

.list {
position: relative;
width: 100%;
list-style-type: none !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we're probably not style linting but we sorta have a no important rule on this team (Which we've written down nowhere).

Can we try to tackle these using the module to scope this? Take a look at how we use .root in other modules to achieve specificity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohhh! yes, absolutely.

className={styles.list}
items={requirements
.sort((a, b) => (a.completed ? -1 : 1))
.map((step, i) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good cause of how its returning an array w/o LIs :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay! :)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants