Skip to content

Commit 66ab258

Browse files
authored
Editor: UI css scope (#32714)
1 parent 2408112 commit 66ab258

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

editor/css/main.css

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,37 @@ hr {
1818
border-top: 1px solid #ccc;
1919
}
2020

21-
button {
21+
.Button {
2222
position: relative;
2323
}
2424

25-
input {
25+
.Input {
2626
vertical-align: middle;
2727
}
2828

29-
input[type="color"]::-webkit-color-swatch-wrapper {
29+
.Input[type="color"]::-webkit-color-swatch-wrapper {
3030
padding: 0;
3131
}
32-
input[type="color"]::-webkit-color-swatch {
32+
.Input[type="color"]::-webkit-color-swatch {
3333
border: none;
3434
}
3535

36-
textarea {
36+
.TextArea {
3737
tab-size: 4;
3838
white-space: pre;
3939
word-wrap: normal;
4040
}
4141

42-
textarea.success {
42+
.TextArea.success {
4343
border-color: #8b8 !important;
4444
}
4545

46-
textarea.fail {
46+
.TextArea.fail {
4747
border-color: #f00 !important;
4848
background-color: rgba(255,0,0,0.05);
4949
}
5050

51-
textarea, input { outline: none; } /* osx */
51+
.TextArea, .Input { outline: none; } /* osx */
5252

5353
.Panel {
5454
-moz-user-select: none;
@@ -268,7 +268,7 @@ textarea, input { outline: none; } /* osx */
268268

269269
/* */
270270

271-
button {
271+
.Button {
272272
color: #555;
273273
background-color: #ddd;
274274
border: 0px;
@@ -280,27 +280,27 @@ button {
280280
outline: none;
281281
}
282282

283-
button:hover {
283+
.Button:hover {
284284
background-color: #fff;
285285
}
286286

287-
button.selected {
287+
.Button.selected {
288288
background-color: #fff;
289289
}
290290

291-
input, textarea {
291+
.Input, .TextArea {
292292
border: 1px solid transparent;
293293
color: #444;
294294
}
295295

296-
input.Number {
296+
.Input.Number {
297297
color: #08f!important;
298298
font-size: 12px;
299299
border: 0px;
300300
padding: 2px;
301301
}
302302

303-
select {
303+
.Select {
304304
color: #666;
305305
background-color: #ddd;
306306
border: 0px;
@@ -309,7 +309,7 @@ select {
309309
outline: none;
310310
}
311311

312-
select:hover {
312+
.Select:hover {
313313
background-color: #fff;
314314
}
315315

@@ -537,11 +537,11 @@ select {
537537
text-align: center;
538538
}
539539

540-
#toolbar button, #toolbar input {
540+
#toolbar .Button, #toolbar .Input {
541541
height: 32px;
542542
}
543543

544-
#toolbar button img {
544+
#toolbar .Button img {
545545
width: 16px;
546546
opacity: 0.5;
547547
}
@@ -648,33 +648,33 @@ select {
648648

649649
@media ( prefers-color-scheme: dark ) {
650650

651-
button {
651+
.Button {
652652
color: #aaa;
653653
background-color: #222;
654654
}
655655

656-
button:hover {
656+
.Button:hover {
657657
color: #ccc;
658658
background-color: #444;
659659
}
660660

661-
button.selected {
661+
.Button.selected {
662662
color: #fff;
663663
background-color: #08f;
664664
}
665665

666-
input, textarea {
666+
.Input, .TextArea {
667667
background-color: #222;
668668
border: 1px solid transparent;
669669
color: #888;
670670
}
671671

672-
select {
672+
.Select {
673673
color: #aaa;
674674
background-color: #222;
675675
}
676676

677-
select:hover {
677+
.Select:hover {
678678
color: #ccc;
679679
background-color: #444;
680680
}

editor/js/libs/ui.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ class UICheckbox extends UIElement {
448448

449449
super( document.createElement( 'input' ) );
450450

451-
this.dom.className = 'Checkbox';
451+
this.dom.className = 'Checkbox Input';
452452
this.dom.type = 'checkbox';
453453

454454
this.dom.addEventListener( 'pointerdown', function ( event ) {
@@ -490,7 +490,7 @@ class UIColor extends UIElement {
490490

491491
super( document.createElement( 'input' ) );
492492

493-
this.dom.className = 'Color';
493+
this.dom.className = 'Color Input';
494494
this.dom.style.width = '32px';
495495
this.dom.style.height = '16px';
496496
this.dom.style.border = '0px';
@@ -545,7 +545,7 @@ class UINumber extends UIElement {
545545
super( document.createElement( 'input' ) );
546546

547547
this.dom.style.cursor = 'ns-resize';
548-
this.dom.className = 'Number';
548+
this.dom.className = 'Number Input';
549549
this.dom.value = '0.00';
550550

551551
this.dom.setAttribute( 'autocomplete', 'off' );
@@ -766,7 +766,7 @@ class UIInteger extends UIElement {
766766
super( document.createElement( 'input' ) );
767767

768768
this.dom.style.cursor = 'ns-resize';
769-
this.dom.className = 'Number';
769+
this.dom.className = 'Number Input';
770770
this.dom.value = '0';
771771

772772
this.dom.setAttribute( 'autocomplete', 'off' );

0 commit comments

Comments
 (0)