Skip to content

Provide multiple icons #178

Open
Open

Description

@solonovamax

It would be very nice if there was a way to provide multiple icons at multiple different resolutions.

For example, a matrix of the following options:

  • icon theme
    • light icon
    • dark icon (not all icons that are useable on a dark background are also usable on a light background & vice-versa. take for example the github icon, there is no way to make it work for both light & dark themes)
  • file type
    • svg
    • png
    • webp
    • avif
    • jxl
  • resolution
    • 32x32
    • 64x64
    • 128x128
    • 512x512

The feed spec also makes no assertions about what file types should be supported by feed readers, so for feed providers there is no way to know which icon types would be supported. This is what made me want to make the issue, because there is no clarification on if an svg icon would be supported or not.

Schema

Perhaps something like the following schema could be used:

test

Proposed JSON Schema for icon and favicon
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
        "icon": { "$ref": "#/$defs/icon" },
        "favicon": { "$ref": "#/$defs/icon" }
    },
    "$defs": {
        "icon": {
            "oneOf": [
                { "$ref": "#/$defs/icon-url" },
                { "$ref": "#/$defs/icons-resolutions" },
                { "$ref": "#/$defs/icons-mimetypes" },
                {
                    "title": "Icon Theme",
                    "description": "A mapping for both dark and light icons",
                    "type": "object",
                    "properties": {
                        "dark": {
                            "oneOf": [
                                { "$ref": "#/$defs/icon-url" },
                                { "$ref": "#/$defs/icons-resolutions" },
                                { "$ref": "#/$defs/icons-mimetypes" }
                            ]
                        },
                        "light": {
                            "oneOf": [
                                { "$ref": "#/$defs/icon-url" },
                                { "$ref": "#/$defs/icons-resolutions" },
                                { "$ref": "#/$defs/icons-mimetypes" }
                            ]
                        }
                    },
                    "required": [ "dark", "light" ]
                }
            ]
        },
        "mimetype": {
            "title": "Mimetype",
            "description": "A mimetype",
            "type": "string",
            "pattern": "^.*/.*$"
        },
        "resolution": {
            "title": "Resolution",
            "description": "A square resolution",
            "type": "string",
            "pattern": "^(\\d+)x\\1$"
        },
        "icon-url": {
            "title": "Icon Url",
            "description": "A url for an icon",
            "type": "string",
            "format": "uri"
        },
        "icons-mimetypes": {
            "title": "Icon Types",
            "description": "A mapping mimetypes to icons",
            "type": "object",
            "propertyNames": { "$ref": "#/$defs/mimetype" },
            "patternProperties": {
                ".*": {
                    "oneOf": [
                        { "$ref": "#/$defs/icon-url" },
                        { "$ref": "#/$defs/icons-resolutions" }
                    ]
                }
            },
            "minProperties": 1
        },
        "icons-resolutions": {
            "title": "Icon Resolutions",
            "description": "A mapping for an icon at multiple resolutions",
            "type": "object",
            "propertyNames": { "$ref": "#/$defs/resolution" },
            "patternProperties": {
                ".*": { "$ref": "#/$defs/icon-url" }
            },
            "minProperties": 1
        }
    }
}

Examples

Here are some examples of valid icons for this schema:

Plain Url

An icon with a single resolution.

{
    "icon": "https://example.com/icon.png"
}
Resolutions

An icon at multiple resolutions to choose from.

{
    "icon": {
        "32x32": "https://example.com/icon-32x32.png",
        "128x128": "https://example.com/icon-128x128.png",
        "512x512": "https://example.com/icon-512x512.png"
    }
}
Mimetypes

An icon with multiple mimetypes to choose from.

{
    "icon": {
        "image/svg+xml": "https://example.com/icon.svg",
        "image/png": "https://example.com/icon.png"
    }
}
Mimetypes & Resolutions

An icon with multiple mimetypes and multiple resolutions to choose from.

{
    "icon": {
        "image/svg+xml": "https://example.com/icon.svg",
        "image/png": {
            "32x32": "https://example.com/icon-32x32.png",
            "128x128": "https://example.com/icon-128x128.png",
            "512x512": "https://example.com/icon-512x512.png"
        },
        "image/webp": {
            "32x32": "https://example.com/icon-32x32.webp",
            "128x128": "https://example.com/icon-128x128.webp",
            "512x512": "https://example.com/icon-512x512.webp"
        }
    }
}
Theme

An icon with a light & a dark variant to choose from.

{
    "icon": {
        "light": "https://example.com/icon-light.png",
        "dark": "https://example.com/icon-dark.png"
    }
}
Theme & Mimetypes & Resolutions

An icon with a light & a dark variant, multiple mimetypes, and multiple resolutions to choose from.

{
    "icon": {
        "light": {
            "image/svg+xml": "https://example.com/icon-light.svg",
            "image/png": {
                "32x32": "https://example.com/icon-light-32x32.png",
                "128x128": "https://example.com/icon-light-128x128.png",
                "512x512": "https://example.com/icon-light-512x512.png"
            },
            "image/webp": {
                "32x32": "https://example.com/icon-light-32x32.webp",
                "128x128": "https://example.com/icon-light-128x128.webp",
                "512x512": "https://example.com/icon-light-512x512.webp"
            }
        },
        "dark": {
            "image/svg+xml": "https://example.com/icon-dark.svg",
            "image/png": {
                "32x32": "https://example.com/icon-dark-32x32.png",
                "128x128": "https://example.com/icon-dark-128x128.png",
                "512x512": "https://example.com/icon-dark-512x512.png"
            },
            "image/webp": {
                "32x32": "https://example.com/icon-dark-32x32.webp",
                "128x128": "https://example.com/icon-dark-128x128.webp",
                "512x512": "https://example.com/icon-dark-512x512.webp"
            }
        }
    }
}

Activity

  1. sjehuda commented on Oct 21, 2025

    @sjehuda

    This could be defined with "link relations".

    #44

    rel="icon"
    type="image/svg+xml"
    resolution="512x512"

    Or it is probably should be as you advise, which is more of proposal #181.

    #181

  2. solonovamax commented on Apr 3, 2026

    @solonovamax
    Author

    Why would you specify alternative icons? This seems like it would add unnecessary complexity, especially since most feed readers only display the favicon of the feed. Introducing variants for dark, light, and multiple sizes makes things more complicated than needed. In most cases, favicons are SVGs anyway, so these variations don’t provide much additional value. In my opinion.

    a few reasons:

    • it would be useful to offer both light and dark icons for use in feed readers, as some icons will contrast badly against the background
    • raster images are not necessarily uncommon
    • when using raster images, not all formats may be supported. it may be desireable to offer webp, avif, or jxl icons and allow a fallback to the larger png icon if the feed reader doesn't support it, to decrease bandwidth
    • when using raster images, it's useful to have multiple sizes then let the feed reader only fetch the minimum size that is necessary for whatever scale it's using, decreasing bandwidth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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