Comments (3)
What do you mean by multiple font families?
One type style may only refer to one family.
What happens in this file is that you can replace the figma font-family name. E.g. if figma exports "helveticaNeue" but you need it to be "Helvetica Neue" to work on the web, this function can help.
from design-token-transformer.
Sorry, my question was not clear. My desire is to have CSS with fallback fonts: IBM Plex Sans, "Helvetica Neue", sans-serif
i.e., my current output is like:
--mytheme-font-h1: 400 2.625rem/3.375rem IBM Plex Sans
But I want:
--mytheme-font-h1: 400 2.625rem/3.375rem IBM Plex Sans, "Helvetica Neue", sans-serif
I have a silly hack right now that looks for "sans" or "mono" in the font name and appends some hard-coded fallbacks based on that, but it would be a lot better if I could specify that in Figma.
from design-token-transformer.
Sadly I don't see a way of how this could be specified within Figma.
I am doing the same with the webFont.js
it used the options provided in the config file for style dictionary. https://amzn.github.io/style-dictionary/#/config?id=platform
So within this options object I would define 'IBM Plex Sans': 'IBM Plex Sans, "Helvetica Neue", sans-serif'
and the webFont.js would replace it.
You may be able to use a comment on the type styles and read this in a custom transformer, but I have not done this yet.
from design-token-transformer.
Related Issues (12)
- Need correction in documentation HOT 2
- missing android platform HOT 3
- Flutter support HOT 7
- Resolve References using Style Dictionary HOT 8
- Transform-tokens workflow always creates the file design-tokens-example.tokens.json HOT 2
- npm run transform-tokens cant find "global" form figma plugin export HOT 1
- Unit transforms don't seem to apply HOT 1
- rgba values becomes #0000000 HOT 1
- build directory less and scss builds contain multiple [object object] lines HOT 4
- Some units are called "pixel" while others are called "pixels" HOT 3
- Support nested variable transformation ([object Object]) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from design-token-transformer.