feat: block text color with stylesheet reloading

This commit is contained in:
Andy O'Neill 2023-02-10 16:32:24 -05:00
parent 02522ef252
commit 5258e785c1
2 changed files with 4 additions and 3 deletions

View file

@ -83,6 +83,7 @@ Blockly.Colours = {
"tertiary": "#FF3355"
},
"text": "#575E75",
"blockText": "#FFFFFF",
"workspace": "#F9F9F9",
"toolboxHover": "#4C97FF",
"toolboxSelected": "#e9eef2",

View file

@ -76,9 +76,9 @@ Blockly.Css.mediaPath_ = '';
* @param {string} pathToMedia Path from page to the Blockly media directory.
*/
Blockly.Css.inject = function(hasCss, pathToMedia) {
// Only inject the CSS once.
// Clear the CSS if it has already been injected.
if (Blockly.Css.styleSheet_) {
return;
document.head.removeChild(Blockly.Css.styleSheet_.ownerNode);
}
// Placeholder for cursor rule. Must be first rule (index 0).
var text = '.blocklyDraggable {}\n';
@ -459,7 +459,7 @@ Blockly.Css.CONTENT = [
'}',
'.blocklyText {',
'fill: #fff;',
'fill: $colour_blockText;',
'font-family: "Helvetica Neue", Helvetica, sans-serif;',
'font-size: 12pt;',
'font-weight: 500;',