Skip to content

Commit b72d60b

Browse files
langermankjoshblack
authored andcommitted
Bug fix: make active label bold in ActionList (#4392)
* make bold * Create wicked-rings-lay.md * snaps --------- Co-authored-by: Josh Black <joshblack@github.com>
1 parent 1f4d2ed commit b72d60b

File tree

3 files changed

+44
-15
lines changed

3 files changed

+44
-15
lines changed

.changeset/wicked-rings-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
Bug fix: make `active` label bold in ActionList

packages/react/src/ActionList/Item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
320320
id={labelId}
321321
sx={{
322322
flexGrow: slots.inlineDescription ? 0 : 1,
323-
fontWeight: slots.inlineDescription || slots.blockDescription ? 'bold' : 'normal',
323+
fontWeight: slots.inlineDescription || slots.blockDescription || active ? 'bold' : 'normal',
324324
marginBlockEnd: slots.blockDescription ? '4px' : undefined,
325325
}}
326326
>

packages/react/src/NavList/__snapshots__/NavList.test.tsx.snap

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ exports[`NavList renders a simple list 1`] = `
1717
}
1818
1919
.c6 {
20+
-webkit-box-flex: 1;
21+
-webkit-flex-grow: 1;
22+
-ms-flex-positive: 1;
23+
flex-grow: 1;
24+
font-weight: 600;
25+
}
26+
27+
.c8 {
2028
-webkit-box-flex: 1;
2129
-webkit-flex-grow: 1;
2230
-ms-flex-positive: 1;
@@ -357,7 +365,7 @@ exports[`NavList renders a simple list 1`] = `
357365
data-component="ActionList.Item--DividerContainer"
358366
>
359367
<span
360-
class="c6"
368+
class="c8"
361369
id=":r2:--label"
362370
>
363371
About
@@ -380,7 +388,7 @@ exports[`NavList renders a simple list 1`] = `
380388
data-component="ActionList.Item--DividerContainer"
381389
>
382390
<span
383-
class="c6"
391+
class="c8"
384392
id=":r3:--label"
385393
>
386394
Contact
@@ -434,6 +442,14 @@ exports[`NavList renders with groups 1`] = `
434442
}
435443
436444
.c10 {
445+
-webkit-box-flex: 1;
446+
-webkit-flex-grow: 1;
447+
-ms-flex-positive: 1;
448+
flex-grow: 1;
449+
font-weight: 600;
450+
}
451+
452+
.c12 {
437453
-webkit-box-flex: 1;
438454
-webkit-flex-grow: 1;
439455
-ms-flex-positive: 1;
@@ -825,7 +841,7 @@ exports[`NavList renders with groups 1`] = `
825841
data-component="ActionList.Item--DividerContainer"
826842
>
827843
<span
828-
class="c10"
844+
class="c12"
829845
id=":r8:--label"
830846
>
831847
Avatar
@@ -894,6 +910,14 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
894910
color: var(--fgColor-default,var(--color-fg-default,#1F2328));
895911
}
896912
913+
.c14 {
914+
-webkit-box-flex: 1;
915+
-webkit-flex-grow: 1;
916+
-ms-flex-positive: 1;
917+
flex-grow: 1;
918+
font-weight: 600;
919+
}
920+
897921
.c10 {
898922
padding: 0;
899923
margin: 0;
@@ -917,8 +941,8 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
917941
--divider-color: transparent !important;
918942
}
919943
920-
.c14:hover:not([aria-disabled]):not([data-inactive]) + .c3,
921-
.c14[data-focus-visible-added] + li {
944+
.c15:hover:not([aria-disabled]):not([data-inactive]) + .c3,
945+
.c15[data-focus-visible-added] + li {
922946
--divider-color: transparent;
923947
}
924948
@@ -1287,7 +1311,7 @@ exports[`NavList.Item with NavList.SubNav does not have active styles if SubNav
12871311
data-component="ActionList.Item--DividerContainer"
12881312
>
12891313
<span
1290-
class="c1 c7"
1314+
class="c1 c14"
12911315
id=":r22:--label"
12921316
>
12931317
Sub Item
@@ -1334,14 +1358,6 @@ exports[`NavList.Item with NavList.SubNav has active styles if SubNav contains t
13341358
flex-grow: 1;
13351359
}
13361360
1337-
.c7 {
1338-
-webkit-box-flex: 1;
1339-
-webkit-flex-grow: 1;
1340-
-ms-flex-positive: 1;
1341-
flex-grow: 1;
1342-
font-weight: 400;
1343-
}
1344-
13451361
.c8 {
13461362
height: 20px;
13471363
-webkit-flex-shrink: 0;
@@ -1363,6 +1379,14 @@ exports[`NavList.Item with NavList.SubNav has active styles if SubNav contains t
13631379
display: none;
13641380
}
13651381
1382+
.c7 {
1383+
-webkit-box-flex: 1;
1384+
-webkit-flex-grow: 1;
1385+
-ms-flex-positive: 1;
1386+
flex-grow: 1;
1387+
font-weight: 600;
1388+
}
1389+
13661390
.c9 {
13671391
-webkit-transform: rotate(0deg);
13681392
-ms-transform: rotate(0deg);

0 commit comments

Comments
 (0)