jupyterlab-blockly
jupyterlab-blockly copied to clipboard
Expand css variables when setting blockly theme
This PR should fix #92.
The issue was that the settings in the blockly theme were defined using css variables, which is not a documented way of defining a theme:
https://github.com/QuantStack/jupyterlab-blockly/blob/a821459760f9dc8a48d39eae27acb64e9d13a4b2/packages/blockly/src/utils.ts#L355-L374
Specifically, the var() function can be used in css styles, but not in css shorthand properties, which are used during application of the blockly theme to determine block sizes. Here is a short description of this process in a similar issue. See here for the relevant part of the code.
See here for a quick demo confirming that var() is not working when determining text width using css shorthand properties.
Issue #92 was, therefore, a result of incorrect calculation for the sizes of text fields.
I also made changes to make sure that the sources of the jupyterlab-blockly package are watched in the development installation.