Skip to content

Export SVGs directly. #151

@lgarron

Description

@lgarron

This issue comes from thewca/worldcubeassociation.org#10526

Icon fonts work fine, but conceptually (and for performance, depending on how things are set up) it would be nicer to allow loading SVGs directly. If we introduce this, I'd like it to:

  • Be easy to use on the client (for dynamic apps) using standardized technologies.
  • Be easy to use on the server using common runtimes.
  • Avoid any proprietary conventions like React.

We'd have to review/resize/lint our SVGs more carefully to support this as well.

I don't have a strong opinion on whether it should be easy to inline the SVG source vs. loading it as an image (or which should even be the default).

One option would be to give each icon its own export, e.g.

  • @cubing/icons/svg/official/333
  • @cubing/icons/svg/unofficial/222

But I suspect this will not be ergonomic enough for some use cases. Hopefully there's a good convention for this. (Perhaps React is now sufficiently compatible with custom elements?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions