Skip to content

Commit

Permalink
Revert #4697 (#4917)
Browse files Browse the repository at this point in the history
  • Loading branch information
moniika authored Jun 16, 2021
1 parent a46dbb3 commit a15bbf1
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 10 deletions.
4 changes: 3 additions & 1 deletion blockly_uncompressed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions core/requires.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ goog.require('Blockly.zelos.Renderer');
// Blockly Themes.
// Classic is the default theme.
goog.require('Blockly.Themes.Classic');
goog.require('Blockly.Themes.Dark');
goog.require('Blockly.Themes.Deuteranopia');
goog.require('Blockly.Themes.HighContrast');
goog.require('Blockly.Themes.Tritanopia');
// goog.require('Blockly.Themes.Modern');
33 changes: 33 additions & 0 deletions core/theme/dark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

/**
* @fileoverview Dark theme.
* @author samelh@google.com (Sam El-Husseini)
*/
'use strict';

goog.provide('Blockly.Themes.Dark');

goog.require('Blockly.Theme');

Blockly.Themes.Dark = Blockly.Theme.defineTheme('dark', {
'base': Blockly.Themes.Classic,
'componentStyles': {
'workspaceBackgroundColour': '#1e1e1e',
'toolboxBackgroundColour': 'blackBackground',
'toolboxForegroundColour': '#fff',
'flyoutBackgroundColour': '#252526',
'flyoutForegroundColour': '#ccc',
'flyoutOpacity': 1,
'scrollbarColour': '#797979',
'insertionMarkerColour': '#fff',
'insertionMarkerOpacity': 0.3,
'scrollbarOpacity': 0.4,
'cursorColour': '#d0d0d0',
'blackBackground': '#333'
}
});
108 changes: 108 additions & 0 deletions core/theme/modern.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

/**
* @fileoverview Modern theme.
* Same colours as classic, but single coloured border.
*/
'use strict';

goog.provide('Blockly.Themes.Modern');

goog.require('Blockly.Theme');


// Temporary holding object.
Blockly.Themes.Modern = {};

Blockly.Themes.Modern.defaultBlockStyles = {
"colour_blocks": {
"colourPrimary": "#a5745b",
"colourSecondary": "#dbc7bd",
"colourTertiary": "#845d49"
},
"list_blocks": {
"colourPrimary": "#745ba5",
"colourSecondary": "#c7bddb",
"colourTertiary": "#5d4984"
},
"logic_blocks": {
"colourPrimary": "#5b80a5",
"colourSecondary": "#bdccdb",
"colourTertiary": "#496684"
},
"loop_blocks": {
"colourPrimary": "#5ba55b",
"colourSecondary": "#bddbbd",
"colourTertiary": "#498449"
},
"math_blocks": {
"colourPrimary": "#5b67a5",
"colourSecondary": "#bdc2db",
"colourTertiary": "#495284"
},
"procedure_blocks": {
"colourPrimary": "#995ba5",
"colourSecondary": "#d6bddb",
"colourTertiary": "#7a4984"
},
"text_blocks": {
"colourPrimary": "#5ba58c",
"colourSecondary": "#bddbd1",
"colourTertiary": "#498470"
},
"variable_blocks": {
"colourPrimary": "#a55b99",
"colourSecondary": "#dbbdd6",
"colourTertiary": "#84497a"
},
"variable_dynamic_blocks": {
"colourPrimary": "#a55b99",
"colourSecondary": "#dbbdd6",
"colourTertiary": "#84497a"
},
"hat_blocks": {
"colourPrimary": "#a55b99",
"colourSecondary": "#dbbdd6",
"colourTertiary": "#84497a",
"hat": "cap"
}
};

Blockly.Themes.Modern.categoryStyles = {
"colour_category": {
"colour": "#a5745b"
},
"list_category": {
"colour": "#745ba5"
},
"logic_category": {
"colour": "#5b80a5"
},
"loop_category": {
"colour": "#5ba55b"
},
"math_category": {
"colour": "#5b67a5"
},
"procedure_category": {
"colour": "#995ba5"
},
"text_category": {
"colour": "#5ba58c"
},
"variable_category": {
"colour": "#a55b99"
},
"variable_dynamic_category": {
"colour": "#a55b99"
}
};

// This style is still being fleshed out and may change.
Blockly.Themes.Modern =
new Blockly.Theme('modern', Blockly.Themes.Modern.defaultBlockStyles,
Blockly.Themes.Modern.categoryStyles);
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"devDependencies": {
"@blockly/block-test": "^1.0.0",
"@blockly/dev-tools": "^2.0.1",
"@blockly/theme-dark": "^1.0.0",
"@blockly/theme-modern": "^2.1.1",
"@wdio/selenium-standalone-service": "^6.11.0",
"babel-eslint": "^10.1.0",
Expand Down
1 change: 0 additions & 1 deletion scripts/gulpfiles/appengine_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function copyAppengineSrc() {
function copyPlaygroundDeps() {
const playgroundDeps = [
'./node_modules/@blockly/dev-tools/dist/index.js',
'./node_modules/@blockly/theme-dark/dist/index.js',
'./node_modules/@blockly/theme-modern/dist/index.js',
'./node_modules/@blockly/block-test/dist/index.js',
];
Expand Down
1 change: 0 additions & 1 deletion tests/playgrounds/advanced_playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
<script src="../themes/test_themes.js"></script>
<script src="./screenshot.js"></script>
<script src="../../node_modules/@blockly/dev-tools/dist/index.js"></script>
<script src="../../node_modules/@blockly/theme-dark/dist/index.js"></script>
<script src="../../node_modules/@blockly/theme-modern/dist/index.js"></script>

<script>
Expand Down

0 comments on commit a15bbf1

Please sign in to comment.