From 5c4677010c4a161d73a9e9499353c4b66e6df337 Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Mon, 29 Jun 2020 11:00:22 -0700 Subject: [PATCH] Fix theme and add example (#3988) --- core/theme.js | 2 +- core/theme/dark.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/theme.js b/core/theme.js index f66021f4d..1304e03fa 100644 --- a/core/theme.js +++ b/core/theme.js @@ -167,7 +167,7 @@ Blockly.Theme.prototype.setCategoryStyle = function(categoryStyleName, */ Blockly.Theme.prototype.getComponentStyle = function(componentName) { var style = this.componentStyles[componentName]; - if (style && typeof propertyValue == 'string' && + if (style && typeof style == 'string' && this.getComponentStyle(/** @type {string} */ (style))) { return this.getComponentStyle(/** @type {string} */ (style)); } diff --git a/core/theme/dark.js b/core/theme/dark.js index c8cc976a4..398497660 100644 --- a/core/theme/dark.js +++ b/core/theme/dark.js @@ -18,7 +18,7 @@ Blockly.Themes.Dark = Blockly.Theme.defineTheme('dark', { 'base': Blockly.Themes.Classic, 'componentStyles': { 'workspaceBackgroundColour': '#1e1e1e', - 'toolboxBackgroundColour': '#333', + 'toolboxBackgroundColour': 'blackBackground', 'toolboxForegroundColour': '#fff', 'flyoutBackgroundColour': '#252526', 'flyoutForegroundColour': '#ccc', @@ -27,6 +27,7 @@ Blockly.Themes.Dark = Blockly.Theme.defineTheme('dark', { 'insertionMarkerColour': '#fff', 'insertionMarkerOpacity': 0.3, 'scrollbarOpacity': 0.4, - 'cursorColour': '#d0d0d0' + 'cursorColour': '#d0d0d0', + 'blackBackground': '#333' } });