Expand css variables when setting blockly theme #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
jupyterlab-blockly/packages/blockly/src/utils.ts
Lines 355 to 374 in a821459
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.