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 its natural viewBox width/height — for consumers that need the logo's real aspect ratio (e.g. to set aspect-ratio or width/height on an <img>) without parsing SVG themselves.

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 localized wordmark's language, if a translated variant is wanted.

Returns ​

LogoMeta | undefined

The LogoMeta, 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