Question:
Why is using the getDesignPreset() function from the wix-widget API returning an empty string?
Product:
Wix Blocks, Velo API (wix-widget)
What are you trying to achieve:
I am trying to get the current design preset in order to set the font size according to each design preset. I saw on the Wix documentation that things like changing font are global to all presets, but I’d like a smaller font for my mobile design preset. I know I can set the font for Text elements using the html attribute like so:
$w('#someTextElement').html = '<p style="font-size: 10px">Custom font size</p>';
and would like to be able to get the design preset to determine what to make the font-size.
What have you already tried:
I have tried following the API’s documentation, and even directly used the example from it. I have tried changing the names of the design presets in case that was somehow an issue, and building the app to a test site to see if it just didn’t work in the Wix Blocks editor. I tried putting the code in my widget’s code, in a public mobule, and in the panel editor, still the promise returns an empty string.
Additional information: