Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
gestalt-design-tokens
Advanced tools
This package contains all of the design tokens used by the Pinterest Gestalt Design System. The tokens are built for multiple platforms using Style Dictionary.
To build the tokens, run the following command from within the package directory /gestalt-design-tokens:
yarn build
You can also build and watch the project so that the output folder automatically updates when new tokens are added, by running:
yarn watch
You should see something like this output in the terminal:
css
✔︎ dist/scss/_variables.scss
android
✔︎ dist/android/space.xml
✔︎ dist/android/colors.xml
ios
✔︎ dist/ios/GestaltDesignTokensColor.h
✔︎ dist/ios/GestaltDesignTokensColor.m
✔︎ dist/ios/GestaltDesignTokensSize.h
✔︎ dist/ios/GestaltDesignTokensSize.m
ios-swift
✔︎ dist/ios-swift/GestaltDesignTokens.swift
ios-swift-separate-enums
✔︎ dist/ios-swift/GestaltDesignTokensColor.swift
✔︎ dist/ios-swift/GestaltDesignTokensSize.swift
This should have created a dist directory and it will look similar to this:
├── README.md
├── config.json
├── tokens/
│ ├── color/
│ ├── base.json
│ ├── space/
│ ├── base.json
├── dist/
│ ├── android/
│ ├── space.xml
│ ├── colors.xml
│ ├── scss/
│ ├── _variables.scss
│ ├── ios/
│ ├── StyleDictionaryColor.h
│ ├── StyleDictionaryColor.m
│ ├── StyleDictionarySize.h
│ ├── StyleDictionarySize.m
│ ├── ios-swift/
│ ├── StyleDictionary.swift
│ ├── StyleDictionaryColor.swift
│ ├── StyleDictionarySize.swift
If you open config.json
you will see there are currently 5 platforms defined: css, android, json, ios, and ios-swift. Each platform has a transformGroup, buildPath, and files. The buildPath and files of the platform should match up to the files what were built.
Pretty nifty! This shows a few things happening:
source
attribute of config.json
. This allows you to split up the token JSON files however you want. For example, there can be multiple JSON files with color
as the top level key, but they get merged properly.{size.font.medium.value}
gets resolved properly.Now let's make a change and see how that affects things. Open up tokens/color/base.json
and change "#111111"
to "#000000"
. After you make that change, save the file and re-run the build command yarn build
. Open up the build files and take a look.
Huzzah!
Now go forth and create! This package is utilizing Style Dictionary. Take a look at all the built-in transforms and formats.
153.2.0 (Jun 12, 2024)
primaryAction
prop to all nested subcomponents (#3622) - Preview linkFAQs
Design tokens style dictionary for Gestalt
The npm package gestalt-design-tokens receives a total of 1,663 weekly downloads. As such, gestalt-design-tokens popularity was classified as popular.
We found that gestalt-design-tokens demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.