OPF

Search docs

Loading documentation…
    OpenPresentation/opf
    Browse docs
    On this page
    View source

    Icons

    Deck-local icons, keyed by name: SVG text ("<svg …>") or an SVG source ("asset:<id>", "./icon.svg", an HTTPS URL or a data URI). An icon names one by its bare name. The SVG is read, never run: a script, an event handler, an external reference or a raster makes it opf/icon-invalid. One paint (or currentColor) makes it a recolorable glyph; several make it a picture with its own colors.

    Metadata

    Definition
    #/$defs/Icons
    Form
    Dictionary
    Source
    spec/schemas/opf.schema.json

    Field index

    This definition uses the forms or value constraints below.

    Complete definition constraints
    Schema constraints
    {
      "type": "object",
      "description": "Deck-local icons, keyed by name: SVG text (\"<svg …>\") or an SVG source (\"asset:<id>\", \"./icon.svg\", an HTTPS URL or a data URI). An `icon` names one by its bare name. The SVG is read, never run: a script, an event handler, an external reference or a raster makes it opf/icon-invalid. One paint (or currentColor) makes it a recolorable glyph; several make it a picture with its own colors.",
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9-]*$"
      },
      "additionalProperties": {
        "type": "string",
        "minLength": 1
      },
      "examples": [
        {
          "brand-mark": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M4 12l5 5L20 6\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"/></svg>"
        }
      ]
    }