Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: ActionList item label weight and spacing if description exists #3490

Merged
merged 5 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/kind-eggs-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Bug fix: ActionList item label weight and spacing if description exists
4 changes: 3 additions & 1 deletion src/ActionList/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
id={labelId}
sx={{
flexGrow: slots.description && slots.description.props.variant !== 'block' ? 0 : 1,
fontWeight: slots.description && slots.description.props.variant !== 'block' ? 'bold' : 'normal',
fontWeight: slots.description ? 'bold' : 'normal',
marginBlockEnd:
slots.description && slots.description.props.variant !== 'inline' ? '4px' : undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be the token space-1 than 4px?

Copy link
Member

Choose a reason for hiding this comment

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

good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can someone let me know what the syntax is meant to look like to access the spacing token here? I couldn't figure it out, gave up and used px 😛

Copy link
Member

@siddharthkp siddharthkp Jul 6, 2023

Choose a reason for hiding this comment

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

- slots.description && slots.description.props.variant !== 'inline' ? '4px' : undefined,
+ slots.description && slots.description.props.variant !== 'inline' ? 1 : undefined,

unlessssssss, styled-system doesn't understand logical properties like marginBlockEnd, only marginRight because the last release was in 2019 (open issue).

We could figure out how to add support for logical properties in primer/react or we could add '4px' for now and move on. I say 4px and move on. (only for primer, look the other way @maraisr 😛)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SIGH haha okay, thanks @siddharthkp!

}}
>
{childrenWithoutSlots}
Expand Down