Skip to content

pantoken-root / plugins/pantoken/logos/src / getLogoMeta

Function: getLogoMeta() ​

getLogoMeta(product, layout?, colorMode?, lang?): LogoMeta | undefined

Beta

Get a logo's metadata, including the rasterised PNG's width/height — for consumers that need to build a dist/<name>.png path (e.g. via @pantoken/cdn) or size an <img> without parsing SVG.

Parameters ​

product ​

Product

The product.

layout? ​

LogoLayout = "horizontal"

The layout (default "horizontal").

colorMode? ​

LogoColorMode = "full-color"

The color treatment (default "full-color").

lang? ​

LogoLang

The localised wordmark's language, if a translated variant is desired.

Returns ​

LogoMeta | undefined

The SVG string, or undefined if that combination doesn't exist.

Example ​

Read a logo's aspect ratio

ts
import { getLogoMeta } from "@pantoken/plugin-logos";

const meta = getLogoMeta("canvas", "horizontal", "color");
meta && meta.width / meta.height; // the logo's real aspect ratio