Skip to content

Refactor the sprite interface and documentation #146

@keichan34

Description

@keichan34

Is your feature request related to a problem? Please describe.

Currently, the sprite interface is only available in charites build (#143 adds support for charites serve), and it is only available using command line options. Additionally, there is some special logic with the current sprite property and trying to parse its URL when building sprites -- my proposed solution would remove the need for that logic.

Describe the solution you'd like
I propose a unified interface for specifying sprite build options in style.yml:

version: 8
metadata:
  "charites:sprites":
    directory: ./icons
    output: ./sprite
    pixel_ratios: [ 1, 2 ]

This is compatible with the Mapbox Style Specification, but probably should be stripped out when compiling the style.json file.

Additionally, a separate page should be added to the documentation regarding the facilities Charites provides for building spritesheets.

Describe alternatives you've considered

  • Automatically detecting an icons directory in the same directory as the style.yml file
    • What happens when you don't want to build sprites? --no-sprites ?
    • Probably this could be combined with the sprite build options for a smooth user experience?

Additional context
Documentation is currently lacking: see #115

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