
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@equinor/eds-tokens
Advanced tools
Design tokens used in the Equinor Design System (EDS), such as colours, spacings and typography.
pnpm add @equinor/eds-tokens
import { tokens } from '@equinor/eds-tokens'
CSS custom properties are also available:
@import '@equinor/eds-tokens/css/variables-static.css'; /* or variables-dynamic.css */
variables-static.css
exposes tokens with fixed values, while
variables-dynamic.css
includes dynamic semantic color tokens.
ot
, woff
or woff2
font required)This repository contains a couple of GitHub Actions workflows:
These workflows demonstrate bi-directional syncing between variables in Figma and design tokens in a codebase using Figma's Variables REST API. For more background and a graphical representation of what these workflows do, see our Syncing design systems using Variables REST API FigJam file.
To use these workflows, you should copy the code in this repository into your organization and modify it to suit the needs of your design processes.
To use the "Sync Figma variables to tokens" workflow, you must be a full member of an Enterprise org in Figma. To use the "Sync tokens to Figma" workflow, you must also have an editor seat.
Both workflows assume that you have a single Figma file with local variable collections, along with one or more tokens json files in the tokens/
directory that adhere* to the draft W3C spec for Design Tokens. For demonstration purposes, this directory contains the tokens exported from the Get started with variables Community file. Have a copy of this file ready if you want to try out the workflow with these existing tokens.
*See
src/token_types.ts
for more details on the format of the expected tokens json files, including the deviations from the draft design tokens spec we've had to make. We expect there to be one tokens file per variable collection and mode.
In addition, you must also have a personal access token for the Figma API to allow these workflows to authenticate with the API. For the "Sync Figma variables to tokens" workflow, the token must have at least the Read-only Variables scope selected. For the "Sync tokens to Figma" workflow, the token must have the Read and write Variables scope selected.
Before running either of these workflows, you'll need to create an encrypted secret in your repository named GH_ACTION_VARIABLES_SYNC_FIGMA_TOKEN
containing your personal access token.
Both workflows are configured to run manually for demonstration purposes, and are designed to be as conservative as possible in their functionality (see details below).
To run the "Sync Figma variables to tokens" workflow:
https://www.figma.com/file/{file_key}/{title}
.tokens/
directory. If there are no changes to be made, then a pull request will not be created.This workflow has some key behaviors to note:
To run the "Sync tokens to Figma" workflow:
https://www.figma.com/file/{file_key}/{title}
. Note: if you are trying out this workflow for the first time, use a file that is separate from your design system to avoid any unintended changes.This workflow has some key behaviors to note:
You can run the GitHub actions locally by running pnpm install
and creating a .env
file.
Example:
PERSONAL_ACCESS_TOKEN="your_personal_access_token"
How to create your personal access token
and then running:
# Defaults to writing to the tokens directory
pnpm run update-tokens
# and / or
pnpm run update-figma
The semantic variable references the first segment (collection) in the variable. For example, the first segment is “appearance” for the action variables. Variables defined in appearance point to the next segment, which for action variables would be prominence. In the prominence collection, we define a variable for each of the appearance modes so that these are represented in the context of each prominence mode. The variables in the “prominence” collection point to variables in the state collection, and again, we represent all the prominence modes as new variables in the state collection. For action variables, the journey ends here, and the variables in the state collection point to the light/dark color scheme variables in the color scheme collection.
The color scheme collection variables support all the combinations of modes in the different collections and are used to generate tokens in code. All the combinations of modes in different collections must be provided here so that the code syntax matches tokens in the code.
To set up tokens in Figma, start with the base value defined in the Colour Scheme collection. Once these are defined, you have all the different combinations of a variable and are ready to set up the collections you want to provide. Using the action variables as an example, you would first create the base values and then start with the variable’s last segment(collection). This is the taxonomy of our action variables: color/action/[appearance]/[prominence]/[state]
. The last segment in this example would be the “state” collection. The state collection references the base values you defined in the Colour Scheme collection. In the state collection, you should define a variable for each mode in the previous segment; in this example, that would be all the modes you want to define in the prominence collection. Example: primary, secondary, tertiary. When this is ready, you continue to the segment before the prominence collection; in this example, this would be the appearance collection. The appearance collection is, in this example, the first segment and, therefore, the last collection you need to create. In this collection, you create all the variables you need. In our token taxonomy, we create a variable for different properties (text, icon, border, surface). These variables should reference the variables you created in the previous collection; in this example, that would be the specific appearance variables you created in the prominence collection.
FAQs
Design tokens for the Equinor Design System
The npm package @equinor/eds-tokens receives a total of 8,761 weekly downloads. As such, @equinor/eds-tokens popularity was classified as popular.
We found that @equinor/eds-tokens demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.