import type { CSSProperties, ReactNode } from 'react' /** * Three properties, each here because of what this surface renders. * * The face is the design system's mono, so a nibble is the same width wherever * it appears and two hashes can be compared down a column rather than read. * Slightly smaller than the prose around it, in `em` and not a token, because a * monospace face set at the same nominal size as the text it sits inside reads * larger than it — the correction is relative to whatever it is quoted in, and * a heading and a footnote do not want the same number. * * And it breaks anywhere. An address is forty unbroken characters and calldata * is hundreds; left alone each is a single unbreakable word that no container * can be narrower than, which is most of what makes a page of chain data * overflow a phone. Breaking them is right — nobody reads a hash across a line, * they copy it — and it is what lets a two-column pair go on shrinking instead * of the pair becoming the widest thing on the page. */ const literal: CSSProperties = { fontFamily: 'var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace)', fontSize: '0.87em', overflowWrap: 'anywhere', } /** * A literal read off the chain — an address, a selector, a hash, a chain name. * * The element and not a text primitive. Half of these sit inside a sentence, * and the primitive lays out as a flex box, which would make a quoted literal * one atomic box that cannot break across a line; it also carries its own * wrapping, which outranks the rule above, and a pair in a two-column grid * would stop shrinking. `code` is already inline, already semantic, and asks * for none of that back. */ export function Code({ children }: { children?: ReactNode }) { return {children} }