GithubHelp home page GithubHelp logo

Comments (3)

lukasoppermann avatar lukasoppermann commented on July 18, 2024

What do you mean by multiple font families?

One type style may only refer to one family.

const fontFamily = ({ fontFamily }, { fontFamilies } = {}) => fontFamilies && fontFamilies[fontFamily] ? fontFamilies[fontFamily] : fontFamily

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.

derekwsgray avatar derekwsgray commented on July 18, 2024

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.

lukasoppermann avatar lukasoppermann commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.