Skip to main content
Jul 24, 2023 9:18 AM UTC
Question

How to find nodes that use a text or colour style

Hi, I want to search and return nodes on the current page where it uses a given text or color style in any way i.e. as a background fill, stroke, text color or font.

AFAIK, I can use fillStyleId to check if a layer’s background is using a color style. In that case, what other node attributes can I use to check for stroke, font and the rest?

This topic has been closed for replies.

3 replies

tank666
Jul 24, 2023 10:13 AM UTC
UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
tank666
Jul 24, 2023 10:16 AM UTC

The Figma Developers website has a search engine.
https://www.figma.com/plugin-docs/search/

UX/UI designer. Figma expert. Creator and developer of plugins and widgets for Figma and FigJam. Check out my resources in Figma Community: figma.com/@tank
James_Yang
Figmate
Figmate
Jul 24, 2023 1:56 PM UTC

If you already have a style, you can use the consumers property on the style: BaseStyle | Plugin API, which will give you all the nodes and the fields where the style is applied.