Skip to content

Conversation

DRiFTy17
Copy link
Collaborator

@DRiFTy17 DRiFTy17 commented Jul 7, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added/updated: N
  • Docs have been added/updated: N
  • Does this PR introduce a breaking change? N
  • I have linked any related GitHub issues to be closed when this PR is merged? N

Describe the new behavior?

As a general best practice in Forge we do not like to set external margins on host elements to ensure the components do not affect layouts with whitespace. Margins are typically something we expect consuming developers to place on the host elements with their own styles.

The list and list item components are unique in that they have some usage patterns for built-in whitespace such as navlist block margin (typically used within dropdown lists), and indented where list items have margin-inline-start applied to convey that they are visually beneath a parent list item.

These styles were previously set on the host element, making them susceptible to global style overrides. This PR moves those styles to the shadow DOM root container element. The CSS variables are still usable, and any margin styles set directly on the host elements will now compound instead of override. Developers should always prefer using the tokens where possible.

Additional information

This was brought up in relation to a global reset stylesheet setting margin: 0 on all (*) elements, and it was conflicting with the indentation styles for nested lists.

@DRiFTy17 DRiFTy17 requested a review from a team as a code owner July 7, 2025 14:51
@DRiFTy17 DRiFTy17 added patch Increment the patch version when merged storybook-preview labels Jul 7, 2025
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Jul 7, 2025

View Storybook Deployment
pr/tyler-technologies-oss:fix-list-margins

Copy link

@tylermcgowan tylermcgowan left a comment

Choose a reason for hiding this comment

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

🙌🏻

@DRiFTy17 DRiFTy17 merged commit 9e39b32 into main Jul 15, 2025
16 checks passed
@DRiFTy17 DRiFTy17 deleted the fix-list-margins branch July 15, 2025 12:14
Copy link
Contributor

🚀 PR was released in v3.10.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released. storybook-preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants