Skip to content

Commit 98dc633

Browse files
authored
ActionList: Fix multiple selection svg by overriding global shape-rendering for github.com (#1668)
* override global shape-rendering for github.com * add changelog * add issue to comment * update snapshots
1 parent 5c6dc64 commit 98dc633

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/components': patch
3+
---
4+
5+
ActionList: Fix multiple selection svg by overriding global shape-rendering for github.com

src/ActionList/Item.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ const MultiSelectIcon = styled.svg<{selected?: boolean}>`
317317
rect {
318318
fill: ${({selected}) => (selected ? get('colors.accent.fg') : get('colors.canvas.default'))};
319319
stroke: ${({selected}) => (selected ? get('colors.accent.fg') : get('colors.border.default'))};
320+
shape-rendering: auto; // this is a workaround to override global style in github/github, see primer/react#1666
320321
}
321322
path {
322323
fill: ${get('colors.fg.onEmphasis')};

src/ActionList2/Selection.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export const Selection: React.FC<SelectionProps> = ({selected}) => {
3838
sx={{
3939
rect: {
4040
fill: selected ? 'accent.fg' : 'canvas.default',
41-
stroke: selected ? 'accent.fg' : 'border.default'
41+
stroke: selected ? 'accent.fg' : 'border.default',
42+
shapeRendering: 'auto' // this is a workaround to override global style in github/github, see primer/react#1666
4243
},
4344
path: {
4445
fill: 'fg.onEmphasis',

src/__tests__/__snapshots__/Autocomplete.test.tsx.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ Array [
513513
.c6 rect {
514514
fill: #ffffff;
515515
stroke: #d0d7de;
516+
shape-rendering: auto;
516517
}
517518
518519
.c6 path {
@@ -1386,6 +1387,7 @@ Array [
13861387
.c6 rect {
13871388
fill: #ffffff;
13881389
stroke: #d0d7de;
1390+
shape-rendering: auto;
13891391
}
13901392
13911393
.c6 path {
@@ -2206,6 +2208,7 @@ Array [
22062208
.c10 rect {
22072209
fill: #ffffff;
22082210
stroke: #d0d7de;
2211+
shape-rendering: auto;
22092212
}
22102213
22112214
.c10 path {
@@ -2216,6 +2219,7 @@ Array [
22162219
.c6 rect {
22172220
fill: #0969da;
22182221
stroke: #0969da;
2222+
shape-rendering: auto;
22192223
}
22202224
22212225
.c6 path {

0 commit comments

Comments
 (0)