Skip to content

Commit

Permalink
Replace all rgba(...) color strings with rgb(...) in SVG exports to f…
Browse files Browse the repository at this point in the history
…ix usage in illustrator/inkscape (#4381)

* Strip all rgba from svg

* Updates

* Bump deps
  • Loading branch information
cmdcolin committed May 10, 2024
1 parent ce391cf commit c5421c0
Show file tree
Hide file tree
Showing 11 changed files with 1,218 additions and 1,191 deletions.
2 changes: 1 addition & 1 deletion packages/core/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ export function renderToStaticMarkup(
render(node, div)
}
})
return div.innerHTML
return div.innerHTML.replaceAll(/\brgba\((.+?),[^,]+?\)/g, 'rgb($1)')
}

export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ exports[`renders one track, one region 1`] = `
style="left: 0%; width: 0%;"
/>
<span
class="MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary css-14eyfr9-MuiSlider-thumb"
class="MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary css-l29f8w-MuiSlider-thumb"
data-index="0"
style="left: 0%;"
>
Expand Down Expand Up @@ -847,7 +847,7 @@ exports[`renders two tracks, two regions 1`] = `
style="left: 0%; width: 9.774680693120512%;"
/>
<span
class="MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary css-14eyfr9-MuiSlider-thumb"
class="MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary css-l29f8w-MuiSlider-thumb"
data-index="0"
style="left: 9.774680693120512%;"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ exports[`<JBrowseLinearGenomeView /> renders successfully 1`] = `
style="left: 0%; width: 56.78411120929245%;"
/>
<span
class="MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary css-1j77ekx-MuiSlider-thumb"
class="MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary MuiSlider-thumb MuiSlider-thumbSizeSmall MuiSlider-thumbColorPrimary css-1nqyqyn-MuiSlider-thumb"
data-index="0"
style="left: 56.78411120929245%;"
>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit c5421c0

Please sign in to comment.