Break CSS into modules. (#3084)

* Break CSS into modules.

Drops the compile test by 3 KB.
Remove obsolete .blocklyDraggable class stub (it used to be dynamically changed).
Remove unused menuseparator CSS.
This commit is contained in:
Neil Fraser
2019-09-25 18:01:19 -07:00
committed by GitHub
parent 06d65b81c7
commit 75cf614104
9 changed files with 318 additions and 287 deletions

View File

@@ -26,6 +26,7 @@
goog.provide('Blockly.FieldColour');
goog.require('Blockly.Css');
goog.require('Blockly.DropDownDiv');
goog.require('Blockly.Events');
goog.require('Blockly.Events.BlockChange');
@@ -588,4 +589,40 @@ Blockly.FieldColour.prototype.dropdownDispose_ = function() {
this.picker_ = null;
};
/**
* CSS for colour picker. See css.js for use.
*/
Blockly.Css.register([
/* eslint-disable indent */
'.blocklyColourTable {',
'border-collapse: collapse;',
'display: block;',
'outline: none;',
'padding: 1px;',
'}',
'.blocklyColourTable>tr>td {',
'border: .5px solid #888;',
'box-sizing: border-box;',
'cursor: pointer;',
'display: inline-block;',
'height: 20px;',
'padding: 0;',
'width: 20px;',
'}',
'.blocklyColourTable>tr>td.blocklyColourHighlighted {',
'border-color: #eee;',
'box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);',
'position: relative;',
'}',
'.blocklyColourSelected, .blocklyColourSelected:hover {',
'border-color: #eee !important;',
'outline: 1px solid #333;',
'position: relative;',
'}'
/* eslint-enable indent */
]);
Blockly.fieldRegistry.register('field_colour', Blockly.FieldColour);