-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description The SVG project icons can't be included via `<img>` because they are colored using `currentColor`. They also can't be included via Parcel's `bundle-text` named pipeline becase The way we used `<sl-icon>`, it was fetching the svg file over the network and dynamically inserting it into the DOM. This instead uses another Parcel plugin to import an svg file as a React component at build time. Getting it to work is kinda finicky. Ssee parcel-bundler/parcel#7587, plus the workaround I ended up using in the not-merged PR parcel-bundler/parcel#7711. The list of transformers for `jsx:*.{js,jsx}` is copied from Parcel's default config for those file types. The icons are set to width `1em` to allow them to be sized by the font-size at the usage site, like `<sl-icon>`. ## Test Plan Look at the project icons in all contexts where they appear: project multiselect, icon tab bar in pill mode, icon tab bar in dropdown mode.
- Loading branch information
Showing
8 changed files
with
448 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "@parcel/config-default", | ||
"transformers": { | ||
"jsx:*.svg": [ | ||
"...", | ||
"@parcel/transformer-svg-react" | ||
], | ||
"jsx:*.{js,jsx}": [ | ||
"@parcel/transformer-babel", | ||
"@parcel/transformer-js", | ||
"@parcel/transformer-react-refresh-wrap" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.