An open API service indexing awesome lists of open source software.

https://github.com/antonvasin/styled-system-figma

Generate theme.js from Figma file
https://github.com/antonvasin/styled-system-figma

design-systems figma styled-components styled-system typescript

Last synced: 3 months ago
JSON representation

Generate theme.js from Figma file

Awesome Lists containing this project

README

        

# styled-system-figma

Generate theme file for [`styled-system`](https://github.com/jxnblk/styled-system) from [Figma](https://www.figma.com) file.

## Install

```shell
yarn add styled-system-figma
# or
npm install --save styled-system-figma
```

## Example

```ts
import generateTheme from 'styled-system-figma';
import * as Figma from 'figma-js';

const fileId = 'FILE_ID';

const client = Figma.Client({
personalAccessToken: 'FIGMA_TOKEN',
});

client.file(fileId).then(({ data }) => {
const theme = generateTheme(data);

fs.writeFileSync('theme.js', JSON.stringify(theme, null, 2));
});
```

## TODO

- [x] `colors`
- [x] `lineHeights`
- [x] `radii`
- [x] `fontSizes`
- [x] `fontWeights`
- [x] `letterSpacings`
- [ ] `fonts`
- [x] `boxShadows`
- [ ] parse styles for names
- [ ] `textVariants`