Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@six7/figma-tokens-helpers
Advanced tools
Exposes functions that utilize Figma Tokens shared plugin data.
Import the functions you need into your plugin.
Returns all tokens stored on document as an object containing token sets that each contain tokens as an array.
Caution: These tokens are unresolved meaning they could use aliases. To get the resolved value according to what token sets were used, see getResolvedTokens
Example usage:
getTokensStoredOnDocument()
Result:
{
"global": {
[
{name: 'colors.white', value: '#ffffff', type: 'color'},
{name: 'fg.default', value: '{colors.white}', type: 'color'}
]
}
}
Reads all tokens stored on the document and the last used token sets and returns an array of tokens with their resolved value according to the set combination.
getResolvedTokens()
Result:
[
{name: 'colors.white', value: '#ffffff', type: 'color', internal__Parent: '_scale/light', rawValue: '#ffffff'}, {name: 'bg.default', value: '#ffffff', type: 'color', internal__Parent: 'light/default', rawValue: '{colors.white}'}
]
Returns the used token sets in the document as they were last used, e.g. if a set was toggled active/set as source or disabled. This has an impact on what values each token has.
getUsedTokenSetsOnDocument()
Result:
{
'global': 'source', 'light': 'disabled', 'dark': 'enbabled'
}
Returns all tokens stored on a node.
getTokensOnNode(figma.currentPage.selection[0])
Result:
{
"fill": "colors.black",
"sizing": "sizing.md"
}
Returns the stored token on a node for a given key
getTokensByKey(figma.currentPage.selection[0], "fill")
Result:
"colors.black"
Merges given tokens with given token sets. This function is being used in getResolvedTokens, but with this function you can feed it custom sets or tokens.
mergeTokens(tokens, sets)
Result:
[
{name: 'colors.white', value: '#ffffff', type: 'color', internal__Parent: '_scale/light', rawValue: '#ffffff'}, {name: 'bg.default', value: '#ffffff', type: 'color', internal__Parent: 'light/default', rawValue: '{colors.white}'}
]
FAQs
Helper functions for using Figma Tokens data
The npm package @six7/figma-tokens-helpers receives a total of 4 weekly downloads. As such, @six7/figma-tokens-helpers popularity was classified as not popular.
We found that @six7/figma-tokens-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.