diff --git a/editor/css/main.css b/editor/css/main.css index f07406cea30262..9c5f7db49a1671 100644 --- a/editor/css/main.css +++ b/editor/css/main.css @@ -18,37 +18,37 @@ hr { border-top: 1px solid #ccc; } -button { +.Button { position: relative; } -input { +.Input { vertical-align: middle; } - input[type="color"]::-webkit-color-swatch-wrapper { + .Input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; } - input[type="color"]::-webkit-color-swatch { + .Input[type="color"]::-webkit-color-swatch { border: none; } -textarea { +.TextArea { tab-size: 4; white-space: pre; word-wrap: normal; } - textarea.success { + .TextArea.success { border-color: #8b8 !important; } - textarea.fail { + .TextArea.fail { border-color: #f00 !important; background-color: rgba(255,0,0,0.05); } -textarea, input { outline: none; } /* osx */ +.TextArea, .Input { outline: none; } /* osx */ .Panel { -moz-user-select: none; @@ -264,7 +264,7 @@ textarea, input { outline: none; } /* osx */ /* */ -button { +.Button { color: #555; background-color: #ddd; border: 0px; @@ -276,27 +276,27 @@ button { outline: none; } - button:hover { + .Button:hover { background-color: #fff; } - button.selected { + .Button.selected { background-color: #fff; } -input, textarea { +.Input, .TextArea { border: 1px solid transparent; color: #444; } -input.Number { +.Input.Number { color: #08f!important; font-size: 12px; border: 0px; padding: 2px; } -select { +.Select { color: #666; background-color: #ddd; border: 0px; @@ -305,7 +305,7 @@ select { outline: none; } - select:hover { + .Select:hover { background-color: #fff; } @@ -533,11 +533,11 @@ select { text-align: center; } - #toolbar button, #toolbar input { + #toolbar .Button, #toolbar .Input { height: 32px; } - #toolbar button img { + #toolbar .Button img { width: 16px; opacity: 0.5; } @@ -644,33 +644,33 @@ select { @media ( prefers-color-scheme: dark ) { - button { + .Button { color: #aaa; background-color: #222; } - button:hover { + .Button:hover { color: #ccc; background-color: #444; } - button.selected { + .Button.selected { color: #fff; background-color: #08f; } - input, textarea { + .Input, .TextArea { background-color: #222; border: 1px solid transparent; color: #888; } - select { + .Select { color: #aaa; background-color: #222; } - select:hover { + .Select:hover { color: #ccc; background-color: #444; } diff --git a/editor/js/libs/ui.js b/editor/js/libs/ui.js index 8c75fec936dace..09eecca1849a78 100644 --- a/editor/js/libs/ui.js +++ b/editor/js/libs/ui.js @@ -448,7 +448,7 @@ class UICheckbox extends UIElement { super( document.createElement( 'input' ) ); - this.dom.className = 'Checkbox'; + this.dom.className = 'Checkbox Input'; this.dom.type = 'checkbox'; this.dom.addEventListener( 'pointerdown', function ( event ) { @@ -490,7 +490,7 @@ class UIColor extends UIElement { super( document.createElement( 'input' ) ); - this.dom.className = 'Color'; + this.dom.className = 'Color Input'; this.dom.style.width = '32px'; this.dom.style.height = '16px'; this.dom.style.border = '0px'; @@ -545,7 +545,7 @@ class UINumber extends UIElement { super( document.createElement( 'input' ) ); this.dom.style.cursor = 'ns-resize'; - this.dom.className = 'Number'; + this.dom.className = 'Number Input'; this.dom.value = '0.00'; this.dom.setAttribute( 'autocomplete', 'off' ); @@ -766,7 +766,7 @@ class UIInteger extends UIElement { super( document.createElement( 'input' ) ); this.dom.style.cursor = 'ns-resize'; - this.dom.className = 'Number'; + this.dom.className = 'Number Input'; this.dom.value = '0'; this.dom.setAttribute( 'autocomplete', 'off' );