Move flyout label css into the renderer (#3780)

* Move flyout label css into the renderer and add theme options
This commit is contained in:
Sam El-Husseini
2020-04-01 15:29:34 -07:00
committed by GitHub
parent f05faffd7a
commit acb5d895f8
3 changed files with 26 additions and 10 deletions

View File

@@ -294,9 +294,5 @@ Blockly.Css.register([
'.blocklyFlyoutLabelBackground {',
'opacity: 0;',
'}',
'.blocklyFlyoutLabelText {',
'fill: #000;',
'}'
/* eslint-enable indent */
]);

View File

@@ -1165,13 +1165,18 @@ Blockly.blockRendering.ConstantProvider.prototype.injectCSS_ = function(
Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(selector) {
return [
/* eslint-disable indent */
// Fields.
selector + ' .blocklyText {',
'fill: #fff;',
// Text.
selector + ' .blocklyText, ',
selector + ' .blocklyFlyoutLabelText {',
'font-family: ' + this.FIELD_TEXT_FONTFAMILY + ';',
'font-size: ' + this.FIELD_TEXT_FONTSIZE + 'pt;',
'font-weight: ' + this.FIELD_TEXT_FONTWEIGHT + ';',
'}',
// Fields.
selector + ' .blocklyText {',
'fill: #fff;',
'}',
selector + ' .blocklyNonEditableText>rect,',
selector + ' .blocklyEditableText>rect {',
'fill: ' + this.FIELD_BORDER_RECT_COLOUR + ';',
@@ -1183,6 +1188,11 @@ Blockly.blockRendering.ConstantProvider.prototype.getCSS_ = function(selector) {
'fill: #000;',
'}',
// Flyout labels.
selector + ' .blocklyFlyoutLabelText {',
'fill: #000;',
'}',
// Bubbles.
selector + ' .blocklyText.blocklyBubbleText {',
'fill: #000;',

View File

@@ -904,13 +904,18 @@ Blockly.zelos.ConstantProvider.prototype.createDom = function(svg,
Blockly.zelos.ConstantProvider.prototype.getCSS_ = function(selector) {
return [
/* eslint-disable indent */
// Fields.
selector + ' .blocklyText {',
'fill: #fff;',
// Text.
selector + ' .blocklyText, ',
selector + ' .blocklyFlyoutLabelText {',
'font-family: ' + this.FIELD_TEXT_FONTFAMILY + ';',
'font-size: ' + this.FIELD_TEXT_FONTSIZE + 'pt;',
'font-weight: ' + this.FIELD_TEXT_FONTWEIGHT + ';',
'}',
// Fields.
selector + ' .blocklyText {',
'fill: #fff;',
'}',
selector + ' .blocklyNonEditableText>rect:not(.blocklyDropdownRect),',
selector + ' .blocklyEditableText>rect:not(.blocklyDropdownRect) {',
'fill: ' + this.FIELD_BORDER_RECT_COLOUR + ';',
@@ -921,6 +926,11 @@ Blockly.zelos.ConstantProvider.prototype.getCSS_ = function(selector) {
selector + ' .blocklyEditableText>g>text {',
'fill: #575E75;',
'}',
// Flyout labels.
selector + ' .blocklyFlyoutLabelText {',
'fill: #575E75;',
'}',
// Bubbles.
selector + ' .blocklyText.blocklyBubbleText {',