Skip to content

Commit 55bd498

Browse files
langermankactions-uservdepizzol
authored
Patch: ActionList divider conflict with inline description (#1892)
* stash change * fix divider for inline description * fix hover state * Create clever-jars-suffer.md * Stylelint auto-fixes * Update clever-jars-suffer.md * Update src/actionlist/action-list.scss Co-authored-by: Vinicius Depizzol <vdepizzol@github.com> Co-authored-by: Actions Auto Build <actions@github.com> Co-authored-by: Vinicius Depizzol <vdepizzol@github.com>
1 parent 74d0438 commit 55bd498

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed

.changeset/clever-jars-suffer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
Patch: Fix ActionList--divided for label with inline description scenarios

docs/src/stories/components/ActionList/ActionListItem.stories.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ export const ListItemTemplate = ({
412412
<span className={clsx('ActionList-item-descriptionWrap', `${descriptionVariant}`)}>
413413
<span className={clsx('ActionList-item-label', truncateItem && 'ActionList-item-label--truncate')}>
414414
{text}
415-
<span className="ActionList-item-description">{description}</span>
416415
</span>
416+
<span className="ActionList-item-description">{description}</span>
417417
</span>
418418
)}
419419
{!description && text && (
@@ -528,9 +528,8 @@ export const ListItemTemplate = ({
528528
<span className={clsx('ActionList-item-descriptionWrap', `${descriptionVariant}`)}>
529529
<span className={clsx('ActionList-item-label', truncateItem && 'ActionList-item-label--truncate')}>
530530
{text}
531-
532-
<span className="ActionList-item-description">{description}</span>
533531
</span>
532+
<span className="ActionList-item-description">{description}</span>
534533
</span>
535534
)}
536535
{!description && text && (

src/actionlist/action-list-item.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@
9292
+ .ActionList-item .ActionList-item-label::before {
9393
visibility: hidden;
9494
}
95+
96+
.ActionList-item-descriptionWrap--inline::before,
97+
+ .ActionList-item .ActionList-item-descriptionWrap--inline::before {
98+
visibility: hidden;
99+
}
95100
}
96101
}
97102
// stylelint-disable-next-line no-duplicate-selectors
@@ -488,6 +493,7 @@
488493

489494
// inline
490495
.ActionList-item-descriptionWrap--inline {
496+
position: relative;
491497
flex-direction: row;
492498
align-items: baseline;
493499

src/actionlist/action-list.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@
2121
background: var(--color-action-list-item-inline-divider);
2222
}
2323

24+
// if descriptionWrap--inline exists, move pseudo divider to wrapper
25+
.ActionList-item-descriptionWrap--inline {
26+
&::before {
27+
position: absolute;
28+
top: -$actionList-item-padding-vertical;
29+
display: block;
30+
width: 100%;
31+
height: $border-width;
32+
content: '';
33+
background: var(--color-action-list-item-inline-divider);
34+
}
35+
36+
// unset the default label pseudo
37+
.ActionList-item-label::before {
38+
content: unset;
39+
}
40+
}
41+
2442
// hide divider if item is active
2543
.ActionList-item--navActive {
2644
// stylelint-disable-next-line selector-max-specificity, selector-max-compound-selectors
@@ -36,3 +54,9 @@
3654
.ActionList-sectionDivider + .ActionList-item .ActionList-item-label::before {
3755
visibility: hidden;
3856
}
57+
58+
// hide if item is first of type with label::before, or is the first item after a sectionDivider
59+
.ActionList-item:first-of-type .ActionList-item-descriptionWrap--inline::before,
60+
.ActionList-sectionDivider + .ActionList-item .ActionList-item-descriptionWrap--inline::before {
61+
visibility: hidden;
62+
}

0 commit comments

Comments
 (0)