Auto-generate SVG aspect ratios #678
Labels
Issue for Full Member
For full members who have attended a coffee session, filled out the new member for, and are in slack
Tech: Typescript
Type: enhancement
New feature or request
Note for Hacktoberfest:
Virtual Coffee is reserving all open issues for Virtual Coffee members for the month of October.
Find out more about becoming a member
Issue Context
The
UndrawIllustration
component is used to display our nice unDraw illustrations.In order to avoid layout jumps, we've added the aspect ratios of the svgs, but they're hard-coded which is hard to keep up to date.
What I'd like to do is generate these automatically.
Proposed solution
Build-time steps (generally):
app/_generatedData
that contains that datapackage.json
UndrawIllustration
to read from that dataThings to think about:
Any time we have generated data, we have to think about the developer experience of using the data during development. For instance, what happens if we change/add an svg? Does it automatically reload, or do I have to stop and start the server again?
Alternatives Considered
There may also be a runtime solution to this (as opposed to build-time) but I can't imagine it would be very performant. Definitely open to discussing options though.
Additional Resources
The
svg-parser
package looks like it could be useful.Code of Conduct
The text was updated successfully, but these errors were encountered: