Tokens Studio for Figma
  • Getting Started
    • Tokens Studio Plugin for Figma
    • Install the Figma Plugin
    • Pro Licence for the Figma Plugin
    • Join the Slack Community
    • Feature Requests - Featurebase
    • Changelog - Featurebase
  • Design Token Fundamentals
    • Intro to Design Tokens
      • Token Anatomy - Type
      • Token Anatomy - Value
      • Token Anatomy - Description
      • Token Anatomy - Name
  • Token Management
    • Token Types
      • Asset
      • Boolean
      • Border - Composite
      • Box Shadow - Composite
      • Color
        • Modified Colors (pro)
        • Gradient Colors
      • Dimension
        • Border Radius
        • Border Width
        • Sizing
        • Spacing
      • Number
      • Opacity
      • Other
      • Text (string)
      • Typography - Composite
        • Font Family
        • Font Weight
        • Font Fallbacks
        • Font Size
        • Line Height
        • Letter Spacing
        • Paragraph Indent
        • Paragraph Spacing
        • Text Case
        • Text Decoration
      • Composition (legacy)
    • Token Values
      • Token Values with References
      • Using Math in Token Values
    • Token Names
      • Token Name Technical Specs
      • Token Groups
      • Edit Token Names
    • Token Description
    • Token Sets
      • JSON View
  • Themes management
    • Themes (pro)
    • Themes that switch
  • Working in Figma
    • Variables and Tokens Studio
    • Styles and Tokens Studio
    • Export to Figma Guide
      • Export Options
      • Export Using Themes (pro)
      • Export Using Token Sets
      • Variables Skipped on Export
      • Styles with Variable References
    • Import from Figma Guide
      • Import Styles from Figma
      • Import Variables from Figma
        • Connect Themes to Imported Variables
        • Imported Variable Types and Token Types
    • Non-local Variables and Styles (pro)
    • Remove Tokens from Figma elements
    • Dev Mode in Figma
  • Settings Management
    • Plugin Settings
    • Base Font Size Setting
    • Token Format - W3C DTCG vs Legacy
  • Token Storage and Sync Integrations
    • Local Document - Figma File Token Storage
      • Figma Data Limits
    • Remote Token Storage Integrations
      • GitHub - Git Sync Provider
      • GitLab - Git Sync Provider
      • Bitbucket - Git Sync Provider
      • Azure DevOps - Git Sync Provider
      • JSONBin - Cloud Sync Provider
      • Supernova - Cloud Sync Provider
      • Tokens Studio Platform - Cloud Sync Provider
      • URL - Server Sync Provider
      • Generic Versioned Storage - Server Sync Provider
    • Multi-file Sync to Remote Storage (pro)
    • Manage Sync Providers
      • Edit Sync Provider
      • Change Active Sync Provider
      • Remove Sync Provider
    • Sync Changes to Remote Storage - Push and Pull
    • Branch Switching (pro) - Version Control
  • Inspect and Debug Tokens
    • Inspect Tokens
    • Remap Tokens
  • Transform Tokens for Development
    • Style Dictionary + SD Transforms
    • Official docs for Style Dictionary
  • Style Dictionary Playground
  • Troubleshooting
    • Reset Tokens from Dev Console
    • Tokens Studio Status
  • Open Source
    • Contribute
    • Shared Plugin Data
Powered by GitBook
On this page
  • Opacity - Token Type
  • Design decisions defined by Opacity Tokens
  • Possible Values
  • Values that reference another Token
  • Apply Opacity Tokens
  • W3C DTCG Token Format
  • Transforming Tokens
  • Resources

Was this helpful?

Edit on GitHub
Export as PDF
PreviousNumberNextOther

Last updated 5 months ago

Was this helpful?

Opacity - Token Type

Opacity Tokens define the transparency of a layer, or how opaque it appears.


Design decisions defined by Opacity Tokens

Opacity Tokens define a layer's opacity. In Figma, they can be applied to any design element that supports reduced opacity.

For example, you might have a Button that changes opacity when hovered over.

  • You could create two Opacity tokens:

    • button.opacity.default with a value of 1 (fully opaque)

    • button.opacity.hover with a value of 0.8 (slightly transparent)

  • Then, apply the Opacity Tokens to the background container layer of each variation of the Button design.


Possible Values

An Opacity Token can define any level of transparency from fully opaque to fully transparent. The values range from:

  • 1 (layer is fully opaque)

  • 0 (layer is fully transparent)

  • Any decimal value between 0 and 1 can be used to set varying levels of transparency.

Values that reference another Token

When trying to reference another Token as the Value for an Opacity Token, you will see Tokens in the dropdown list that are:

  • Living in Token Sets that are currently active.

    • In the left menu on the plugin's Tokens page, a checkmark is visible next to the Token Set name.

  • Token Type is compatible:

    • The same = opacity


Apply Opacity Tokens

You can apply an Opacity Token to change the transparency value of any design element and all of its children layers.

With one or more elements selected in Figma, click on the name of your chosen Opacity Token in the Plugin to apply its value instantly.


W3C DTCG Token Format


Transforming Tokens

When transforming Opacity Tokens, there are specific configurations to be aware of.

For Opacity Token values entered in percentages, the SD-transforms package converts the value from % to number between 0 and 1 -> ts/opacity.


Resources

Mentioned in this doc:

Figma resources:

CSS resources:

Community resources:

  • None yet!

Known issues and bugs

    • Values entered less than 1% are resolving to 1% in Figma

    • Ex: 0.1% will resolve to 1%

    • Including an Opacity Token in the value of a Color Token produces unexpected results.

    • We may want to avoid using Opacity Tokens in Color Token values as Figma assigns the Opacity value to layer transparency and not a color modifier.

    • When Exporting Color Tokens with Opacity Tokens referenced in the value as Color Variables, the Variable is not created as expected.

    • Likely related to issue 1822 above.

Requests, roadmap and changelog

  • None yet

Opacity is not yet an official token type in the W3C DTCG specifications, but there is mention of a Percentage/radio type under consideration ()

Engineers typically transform Tokens used in code with , which is tool-agnostic. Tokens coming from Tokens Studio require an additional step: , an npm package that prepares Tokens for Style Dictionary.

→

SD-Transforms -

Style Dictionary -

Design Tokens Community Group -

Design Tokens Community Group -

Design in Figma -

MDN Web Docs -

Tokens Studio Plugin GitHub -

Opacity issue: some values are wrongly rounded in Figma

Referencing a (base+opacity) and adding another opacity to that, doesn't give the correct result

Using Opacity in Tokens Creates Blank Variable

8.8 Additional Types
Style Dictionary
@Tokens-studio/sd-transforms
SD-Transforms Read-Me Doc, ts/opacity
Read Me
https://styledictionary.com/
W3C Draft
8.8 Additional Types
Adjust the properties of an asset
Opacity
Open issues for Token Type Opacity
#2380
#1822
#2977

💌 Visit to contribute or subscribe to updates.

https://feedback.tokens.studio/

🐞 If you are experiencing an issue not listed here, please reach out to us on the Troubleshooting channel of our , , or send us an email support@tokens.studio

community Slack
submit it on our feedback tool

💡 Something to share?

Submit it here!

Once a Token has been applied, it will remain attached until you manually remove it.

However, like all Token Types, you can "force" a reference by manually entering the Token Name between curly brackets.

For example {token.name.here}

The value will show a broken reference until the originating Token Set is marked as enabled.

Jump to the guide on Token Values with References by selecting the card below to learn more.

Token Values with References
Creating a new Opacity Token in the Tokens Studio Plugin for Figma.
Page cover image