Skip to content
Open
Show file tree
Hide file tree
Changes from all 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/deep-impalas-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Change actionlist item inline description styling from flex to block to fix overflow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 5 additions & 9 deletions packages/react/src/ActionList/ActionList.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -628,27 +628,23 @@ default block */
/* inline */
&:where([data-description-variant='inline']) {
position: relative;
display: block;
word-break: normal;
flex-direction: row;
align-items: baseline;
gap: var(--base-size-8);
/* stylelint-disable-next-line primer/typography */
line-height: normal;
Comment on lines +633 to +634
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting the line-height was necessary because with flex previously, the container height is determined by the tallest item's content. With the display:block, the block/inline layout inherits line-height from ancestor elements, which can vary depending on context and create extra vertical spacing. We need to reset this to prevent the spacing mismatch.

Including the disable instead of using a Primer typography variable was necessary because

  • There's no Primer variable that represents a "reset" or "normal" line-height
  • Using explicit values like 20px or var(--control-medium-lineBoxHeight) didn't work consistently across all contexts - some VRT tests passed while others failed
  • line-height: normal lets the browser calculate the natural line-height based on the font metrics, which produces consistent results that match the original flex baseline alignment behavior across all usage contexts


& .ItemLabel {
word-break: normal;
}

&:has([data-truncate='true']) {
& .ItemLabel {
flex: 1 0 auto;
}
}

& .Description {
margin-left: var(--base-size-8);
/* adjust line-height for baseline alignment */

/* line-height: calc(var(--control-medium-lineBoxHeight) - var(--base-size-2)); */
/* stylelint-disable-next-line primer/typography */
line-height: 16px;
overflow-wrap: break-word;
}
}
}
Expand Down
Loading