import{n as e}from"./chunk-BneVvdWh.js";import{t}from"./jsx-runtime-C2wGStra.js";import{l as n,o as r}from"./iframe-D-oZzXNK.js";import{r as i}from"./react-B8jdHdWa.js";import{t as a}from"./mdx-react-shim-8vvjMMnP.js";function o(e){let t={a:`a`,code:`code`,h1:`h1`,p:`p`,pre:`pre`,...i(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r,{title:`Utilities/getTokenVar`}),`
`,(0,c.jsx)(t.h1,{id:`gettokenvartoken`,children:`getTokenVar(token)`}),`
`,(0,c.jsxs)(t.p,{children:[`This utility allows you to retrieve a token's CSS variable as a string, eg. `,(0,c.jsx)(t.code,{children:`var(--abc123)`}),`;`]}),`
`,(0,c.jsx)(t.pre,{children:(0,c.jsx)(t.code,{className:`language-ts`,children:`import { color } from '@preply/ds-core';
import { getTokenVar } from '@preply/ds-web-core';

const myStyle = getTokenVar(color.background.primary);
`})}),`
`,(0,c.jsxs)(t.p,{children:[`Note that the actual value depends on the parent `,(0,c.jsx)(t.code,{children:`ThemeProvider`}),`.`]}),`
`,(0,c.jsxs)(t.p,{children:[`Use the `,(0,c.jsx)(t.a,{href:`/story/guides-token-explorer--page`,children:`Token Explorer`}),` to search tokens by name, id, or value
(make sure you have the correct theme selected).`]})]})}function s(e={}){let{wrapper:t}={...i(),...e.components};return t?(0,c.jsx)(t,{...e,children:(0,c.jsx)(o,{...e})}):o(e)}var c;e((()=>{c=t(),a(),n()}))();export{s as default};