Compartment performance question

HI, i have a question on what is actually better for a dynamic theme to be configured. I have a set of specs that are based on css variables. that means that the theme specs will never change. But the current behavior of the theme plugins is to update all the theme on a compartment to handle the transaction for the editor to realize that the theme change form light to dark, and so on…

  1. Is it better to have 1 theme in the compartment that has the specs and the (isDark) option in it, or is it better to have 2 themes, one with the specs and the other with the option (isDark) on the compartment?
  2. is there other way to send the transaction for the theme (light or dark) on the editor?

My main concern is that 1 theme holding both will cause an necessary processing of the specs that will not change at all.

I don’t think this will matter at all, performance-wise.

A compartment is the most straightforward way to handle this, I think.

1 Like