/figma-leading-trim

Figma plugin for trimming space above and below text elements

Primary LanguageTypeScriptMIT LicenseMIT

figma-leading-trim

Figma plugin for trimming text elements, removing space above capital letters and below the baseline.

If you want to achieve the same behaviour in a browser, check out Capsize.

Development guide

Pre-requisites

Build the plugin

To build the plugin:

$ pnpm build

This will generate a manifest.json file and a build/ directory containing the JavaScript bundle(s) for the plugin.

To watch for code changes and rebuild the plugin automatically:

$ pnpm watch

Install the plugin

  1. In the Figma desktop app, open a Figma document.
  2. Open the Quick Actions search bar (Cmd + /) and run Import plugin from manifest…
  3. Select the manifest.json file that was generated by the build/watch script.

Debugging

To open the developer console, search for and run Open Console via the Quick Actions search bar. Just like in a browser, you can use console.log statements to inspect values in your code.

See also

Official docs and code samples from Figma:

Credit

License

MIT.