File tree Expand file tree Collapse file tree 4 files changed +37
-3
lines changed
docs/src/stories/components/ActionList Expand file tree Collapse file tree 4 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @primer/css " : patch
3+ ---
4+
5+ Patch: Fix ActionList--divided for label with inline description scenarios
Original file line number Diff line number Diff 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 && (
Original file line number Diff line number Diff line change 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
488493
489494// inline
490495.ActionList-item-descriptionWrap--inline {
496+ position : relative ;
491497 flex-direction : row ;
492498 align-items : baseline ;
493499
Original file line number Diff line number Diff line change 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
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+ }
You can’t perform that action at this time.
0 commit comments