How to Edit variables code syntax based on current mode

When I edit code syntax for variables, I want to set default value based on the current layer
For Example, I have a blue-1 variable, when I change to dev mode, I want this code syntax change to:

  • var(blue-1, #e6f4ff) for Light mode;
  • var(blue-1, #111a2c) for Dark mode
    How I can achieve this ? Is there any api to get the current mode value ? Thanks