This release introduces two major new features - framework integrations and much better color support.
This release introduces two major new features - framework integrations and much better color support. The color support is straightforward - Handoff now supports much broader color options from Figma including gradients (linear and radial), as well as layered colors, alpha channels and blend modes.
Framework integrations is Handoff's new plugin architecture for integrating tokens with popular web and application frameworks. Previous versions of Handoff were tightly coupled with Boostrap 5.2 as a proof of concept.
To integrate tokens into applications, the tokens need to be mapped to the the files you'll need. In web applications, this means mapping css and sass variables to existing variables, or extending classes with the tokens.
When fetch is run, any files added to the integration
folder will be merged
with the selected integration. The sass files will be published to
/exported/{integration}-tokens
Integrations also move the templates into integrations so each framework integration can define the markup for each component, type, and state. This allows handoff to include default markup for common frontend frameworks.
exported/variables
file was renamed to exported/tokens
exported/{integration}-tokens
containing the
maps and extended sass integration files./integration
folder that will be merged with
the configured integration sass and templates.integration
is an object that contains two properties name
and
version
. If you set integration.name
to custom
and version
to null
the project will expect a fully defined integration in the /integration
dir.figma
is an object that allows customization of how components are fetched.
figma.components
contains a list of the componentsfigma.components.button
will
define how buttons are fetched from figma.search
property determines the library component and name of the frame
to look in for the component. Setting figma.components.button.search
to
Unicorn
will try to find a button structure in a library object called
Unicorn
.size
property of each component will define a size map allowing projects
to map figma sizes to token names.hex
, type
, and rgb
properties were dropped from the ColorObjectvalue
contains the CSS set of color values, either as hex, rgb, rgba, or
gradientsblend
contains a set of blend modes as CSS values that map against the
colors/integration
in the root of the project to hold integration
configuration./integration/templates
directory./integration/sass
and modified to match the new structure.