Visible Property 2 let you use layer's name to connect the Element's property and the text's value that will speed-up your design system process. This plugin will update the text follow reference's properties whenever it is modified.
- Define reference element by add "#" in front of layer name. For example #color
- Defile text element you want to update (#reference + . + method) For example #color.fill, #color.fillRGB, #color.height etc.
- call plugin by "cmd + /" -> "visible property 2"
- fill -> #123456 78%
- fillRGB -> rgba(123, 456, 789, 1)
- fillHSL -> hsla(123, 456, 789, 0.1)
- fillHSB -> hsba(123, 456, 789, 0.1)
- fillStyle -> DarkBlue
- fillStyleDescription -> The Description
- stroke -> #123456
- strokeRGB -> rgba(123, 456, 789, 1)
- strokeHSL -> hsla(123, 456, 789, 0.1)
- strokeHSB -> hsba(123, 456, 789, 0.1)
- strokeStyle -> DarkBlue
- strokeStyleDescription -> The Description
- font -> Roboto
- fontWeight -> Bold
- fontSize -> 12
- paragraphIndent -> 12
- paragraphSpace -> 12
- letterSpace -> 12 or 12%
- lineHeight -> 12 or 12%
- textStyle -> Body
- textStyleDescription -> The Description
- height -> 32
- width -> 64
- description
To build the plugin:
$ npm run 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:
$ npm run watch
- In the Figma desktop app, open a Figma document.
- Search for and run
Import plugin from manifest…
via the Quick Actions search bar. - Select the
manifest.json
file that was generated by thebuild
script.
Use console.log
statements to inspect values in your code.
To open the developer console, search for and run Open Console
via the Quick
Actions search bar.
Official docs and code samples from Figma: