Skip to content

Commit

Permalink
ActionList: Fix multiple selection svg by overriding global shape-ren…
Browse files Browse the repository at this point in the history
…dering for github.com (#1668)

* override global shape-rendering for github.com

* add changelog

* add issue to comment

* update snapshots
  • Loading branch information
siddharthkp committed Nov 30, 2021
1 parent 5c6dc64 commit 98dc633
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/actionlist-fix-selection-rendering.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/components': patch
---

ActionList: Fix multiple selection svg by overriding global shape-rendering for github.com
1 change: 1 addition & 0 deletions src/ActionList/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ const MultiSelectIcon = styled.svg<{selected?: boolean}>`
rect {
fill: ${({selected}) => (selected ? get('colors.accent.fg') : get('colors.canvas.default'))};
stroke: ${({selected}) => (selected ? get('colors.accent.fg') : get('colors.border.default'))};
shape-rendering: auto; // this is a workaround to override global style in github/github, see primer/react#1666
}
path {
fill: ${get('colors.fg.onEmphasis')};
Expand Down
3 changes: 2 additions & 1 deletion src/ActionList2/Selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export const Selection: React.FC<SelectionProps> = ({selected}) => {
sx={{
rect: {
fill: selected ? 'accent.fg' : 'canvas.default',
stroke: selected ? 'accent.fg' : 'border.default'
stroke: selected ? 'accent.fg' : 'border.default',
shapeRendering: 'auto' // this is a workaround to override global style in github/github, see primer/react#1666
},
path: {
fill: 'fg.onEmphasis',
Expand Down
4 changes: 4 additions & 0 deletions src/__tests__/__snapshots__/Autocomplete.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ Array [
.c6 rect {
fill: #ffffff;
stroke: #d0d7de;
shape-rendering: auto;
}
.c6 path {
Expand Down Expand Up @@ -1386,6 +1387,7 @@ Array [
.c6 rect {
fill: #ffffff;
stroke: #d0d7de;
shape-rendering: auto;
}
.c6 path {
Expand Down Expand Up @@ -2206,6 +2208,7 @@ Array [
.c10 rect {
fill: #ffffff;
stroke: #d0d7de;
shape-rendering: auto;
}
.c10 path {
Expand All @@ -2216,6 +2219,7 @@ Array [
.c6 rect {
fill: #0969da;
stroke: #0969da;
shape-rendering: auto;
}
.c6 path {
Expand Down

0 comments on commit 98dc633

Please sign in to comment.