Socket
Socket
Sign inDemoInstall

@figma-export/output-styles-as-css

Package Overview
Dependencies
5
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @figma-export/output-styles-as-css

Outputter for @figma-export that exports styles to CSS


Version published
Weekly downloads
796
decreased by-4.9%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@figma-export/output-styles-as-css

Styles Outputter for @figma-export that exports styles to CSS.

With this outputter you can export all the styles as variables inside a .css file.

This is a sample of the output:

$ tree output/
# output/
# └── _variables.css

.figmaexportrc.js

You can easily add this outputter to your .figmaexportrc.js:

module.exports = {
    commands: [
        ['styles', {
            fileId: 'fzYhvQpqwhZDUImRz431Qo',
            outputters: [
                require('@figma-export/output-styles-as-css')({
                    output: './output'
                })
            ]
        }],
    ]
}

output is mandatory.

getFilename and getVariableName are optional.

const { kebabCase } = require('@figma-export/utils');

...

require('@figma-export/output-styles-as-css')({
    output: './output',
    getFilename: () => '_variables',
    getVariableName = (style, descriptor) => `${kebabCase(style.name).toLowerCase()}${descriptor != null ? `-${descriptor}` : ''}`,
})

defaults may change, please refer to ./src/index.ts

Install

Using npm:

npm install --save-dev @figma-export/output-styles-as-css

or using yarn:

yarn add @figma-export/output-styles-as-css --dev

Keywords

FAQs

Last updated on 25 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc