Built-in transforms
attribute/cti
Adds: category, type, item, subitem, and state on the attributes object based on the location in the style dictionary.
attribute/color
Adds: hex, hsl, hsv, rgb, red, blue, green.
name/human
Creates a human-friendly name
name/camel
Creates a camel case name. If you define a prefix on the platform in your config, it will prepend with your prefix
name/kebab
Creates a kebab case name. If you define a prefix on the platform in your config, it will prepend with your prefix
name/snake
Creates a snake case name. If you define a prefix on the platform in your config, it will prepend with your prefix
name/constant
Creates a constant-style name based on the full CTI of the token. If you define a prefix on the platform in your config, it will prepend with your prefix
name/pascal
Creates a Pascal case name. If you define a prefix on the platform in your config, it will prepend with your prefix
color/rgb
Transforms the value into an RGB string
color/hsl
Transforms the value into an HSL string or HSLA if alpha is present. Better browser support than color/hsl-4
color/hsl-4
Transforms the value into an HSL string, using fourth argument if alpha is present.
color/hex
Transforms the value into an 6-digit hex string
color/hex8
Transforms the value into an 8-digit hex string
color/hex8android
Transforms the value into an 8-digit hex string for Android because they put the alpha channel first
color/composeColor
Transforms the value into a Color class for Compose
color/UIColor
Transforms the value into an UIColor class for iOS
color/UIColorSwift
Transforms the value into an UIColor swift class for iOS
color/ColorSwiftUI
Transforms the value into an UIColor swift class for iOS
color/css
Transforms the value into a hex or rgb string depending on if it has transparency
color/sketch
Transforms a color into an object with red, green, blue, and alpha attributes that are floats from 0 - 1. This object is how Sketch stores colors.
size/sp
Transforms the value into a scale-independent pixel (sp) value for font sizes on Android. It will not scale the number.
size/dp
Transforms the value into a density-independent pixel (dp) value for non-font sizes on Android. It will not scale the number.
size/object
Transforms the value into a useful object ( for React Native support )
size/remToSp
Transforms the value from a REM size on web into a scale-independent pixel (sp) value for font sizes on Android. It WILL scale the number by a factor of 16 (or the value of ‘basePxFontSize’ on the platform in your config).
size/remToDp
Transforms the value from a REM size on web into a density-independent pixel (dp) value for font sizes on Android. It WILL scale the number by a factor of 16 (or the value of ‘basePxFontSize’ on the platform in your config).
size/px
Adds ‘px’ to the end of the number. Does not scale the number
size/rem
Adds ‘rem’ to the end of the number. Does not scale the number
size/remToPt
Scales the number by 16 (or the value of ‘basePxFontSize’ on the platform in your config) and adds ‘pt’ to the end.
size/compose/remToSp
Transforms the value from a REM size on web into a scale-independent pixel (sp) value for font sizes in Compose. It WILL scale the number by a factor of 16 (or the value of ‘basePxFontSize’ on the platform in your config).
size/compose/remToDp
Transforms the value from a REM size on web into a density-independent pixel (dp) value for font sizes in Compose. It WILL scale the number by a factor of 16 (or the value of ‘basePxFontSize’ on the platform in your config).
size/compose/em
Adds the .em Compose extension to the end of a number. Does not scale the value
size/swift/remToCGFloat
Scales the number by 16 (or the value of ‘basePxFontSize’ on the platform in your config) to get to points for Swift and initializes a CGFloat
size/remToPx
Scales the number by 16 (or the value of ‘basePxFontSize’ on the platform in your config) and adds ‘px’ to the end.
size/pxToRem
Scales non-zero numbers to rem, and adds ‘rem’ to the end. If you define a “basePxFontSize” on the platform in your config, it will be used to scale the value, otherwise 16 (default web font size) will be used.
html/icon
Takes an HTML entity and transforms it into a form CSS can use.
content/quote
Wraps the value in a single quoted string
content/objC/literal
Wraps the value in a double-quoted string and prepends an ’@’ to make a string literal.
content/swift/literal
Wraps the value in a double-quoted string to make a string literal.
time/seconds
Assumes a time in miliseconds and transforms it into a decimal
asset/url
Wraps the value in a CSS url()
function
asset/base64
Wraps the value in a double-quoted string and prepends an ’@’ to make a string literal.
asset/path
Prepends the local file path
asset/objC/literal
Wraps the value in a double-quoted string and prepends an ’@’ to make a string literal.
asset/swift/literal
Wraps the value in a double-quoted string to make a string literal.
color/hex8flutter
Transforms the value into a Flutter Color object using 8-digit hex with the alpha chanel on start
content/flutter/literal
Wraps the value in a double-quoted string to make a string literal.
asset/flutter/literal
Wraps the value in a double-quoted string to make a string literal.
size/flutter/remToDouble
Scales the number by 16 (or the value of ‘basePxFontSize’ on the platform in your config) to get to points for Flutter