On the web page where the map shows (using Mapbox GL) and I want to add legend. The icons in the mapbox map are in a sprite with the details in JSON. I can see the PNG sprite and JSON in the browser console. The JSON looks like:
What's the best way to create a CSS class for the marker icons? For performance reasons I'm hoping to avoid loading the PNG image a second time.