Crate figtok_tokens
source ·Modules§
Structs§
- Figma Token Studio provides Shadow token values as Objects (similarly to a composition token) However, unlike a composition token they have a predictable schema that we can build a struct from. ShadowValue stores these values as a Vec of
ShadowLayer
structs that can be either a drop shadow or an inner shadow. - A TokenDefinition stores the raw data of a token, with a generic property denoting the type of token (Standard, Shadow, Composition, etc.) Most tokens are expressed as
Standard
tokens - where the value is a simpleString
, althoughShadow
andComposition
tokens require different serialization methods, and therefore we can implget_value
for each type. - A TokenSet stores a Vec of Token IDs, these Tokens are stored in the Figtok TokenStore and can therefore be accessed by iterating over the ids.
Enums§
- An enum used to define the two methods of serialization.
- The Token enum holds a TokenDefinition
and provides an abstraction with getters for the properties of a Token (name, id, kind, value.) - Each individual token type, usually mapping 1:1 to a css property with the exception of
Composition
andDimension
Traits§
TokenStore
is a trait that defines a storage interface for managing, retrieving, and transforming design tokens.