Skip to main content

Please expose the dark mode API to plugins

  • September 22, 2022
  • 2 replies
  • 877 views

LitoMore

Hi Figma team!

I’m working on the plugin Simple Icons. My idea is to keep my plugin the same theme as Figma’s main window.

I found it has data-preferred-theme="dark" on its body element. But I don’t know how to access it in a plugin.

Is there any API in plugin that can access the Figma’s main window?

If not, we might be able to expose an API for the dark mode. Like:

type Theme = 'light' | 'dark' | 'system'

interface PluginAPI {
  // ...
  readonly theme: Theme
  setTheme(theme: Theme): void

Seems the Plugin and Widget API is not open source. Please let me know if there is anything I can help with.

Thanks!

2 replies

tank666
  • 4873 replies
  • September 22, 2022

LitoMore
  • Author
  • 1 reply
  • September 22, 2022

@tank666 Wow! Thank you so much! This is what I want!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings