
I’m trying to add a property to my custom widget that accepts a dictionary.
The dictionary is expected to include css rules in the following structure:
{
<selector>: {<property>: <value>},
...
}
On the python side I defined the property like this:
custom_styles = Dict(String, Dict(String, Either(String, Either(Float, Int))), default=None, help=""""
Additional CSS rules.
""")
On the typescript side:
custom_styles: p.Property<{[key: string]: any} | null>
and
custom_styles: [ Nullable(Dict(String, Dict(String, Or(String, Number)))), null ],
When loading the widget, I get the following error in the console:
The invalid value that’s specified in the error is the value that I set for the property.
Any idea what’s wrong here?

