1
1
<template >
2
2
<div
3
3
ref =" vueCommandRef"
4
- class =" vue-command" >
4
+ :class =" {
5
+ 'vue-command': !invert,
6
+ 'vue-command--invert': invert
7
+ }" >
5
8
<slot name =" bar" >
6
9
<div
7
10
v-if =" !hideBar"
8
- class =" vue-command__bar" >
11
+ :class =" {
12
+ 'vue-command__bar': !invert,
13
+ 'vue-command__bar--invert': invert
14
+ }" >
9
15
<!-- TODO Emit unique event per button -->
10
- <span class =" vue-command__bar__button vue-command__bar__button--close" ></span >
11
- <span class =" vue-command__bar__button vue-command__bar__button--minimize" ></span >
12
- <span class =" vue-command__bar__button vue-command__bar__button--fullscreen" ></span >
16
+ <span
17
+ :class =" {
18
+ 'vue-command__bar__button': !invert,
19
+ 'vue-command__bar__button--invert': invert,
20
+ 'vue-command__bar__button--close': !invert,
21
+ 'vue-command__bar__button--close--invert': invert
22
+ }" >
23
+ </span >
24
+ <span
25
+ :class =" {
26
+ 'vue-command__bar__button': !invert,
27
+ 'vue-command__bar__button--invert': invert,
28
+ 'vue-command__bar__button--minimize': !invert,
29
+ 'vue-command__bar__button--minimize--invert': invert
30
+ }" >
31
+ </span >
32
+ <span
33
+ :class =" {
34
+ 'vue-command__bar__button': !invert,
35
+ 'vue-command__bar__button--invert': invert,
36
+ 'vue-command__bar__button--fullscreen': !invert,
37
+ 'vue-command__bar__button--fullscreen--invert': invert
38
+ }" >
39
+ </span >
13
40
</div >
14
41
</slot >
15
42
16
43
<div
17
44
ref =" vueCommandHistoryRef"
18
- class =" vue-command__history"
45
+ :class =" {
46
+ 'vue-command__history': !invert,
47
+ 'vue-command__history--invert': invert
48
+ }"
19
49
@click =" autoFocus" >
20
50
<div
21
51
v-for =" (component, index) in local.history"
22
52
v-show =" shouldShowHistoryEntry(index)"
23
53
:key =" index"
24
54
:class =" {
25
- 'vue-command__history__entry': true,
26
- 'vue-command__history__entry--fullscreen': shouldBeFullscreen(index)
55
+ 'vue-command__history__entry': !invert,
56
+ 'vue-command__history__entry--invert': invert,
57
+ 'vue-command__history__entry--fullscreen': shouldBeFullscreen(index),
58
+ 'vue-command__history__entry--fullscreen--invert': invert && shouldBeFullscreen(index)
27
59
}" >
28
60
<!-- User given components like bash and query -->
29
61
<component
30
62
:is =" component"
31
63
ref =" vueCommandHistoryEntryComponentRefs"
32
- class =" vue-command__history__entry__component" />
64
+ :class =" {
65
+ 'vue-command__history__entry__component': !invert,
66
+ 'vue-command__history__entry__component--invert': invert
67
+ }" />
33
68
</div >
34
69
</div >
35
70
</div >
@@ -134,6 +169,12 @@ const props = defineProps({
134
169
type: Number
135
170
},
136
171
172
+ invert: {
173
+ default: false ,
174
+ required: false ,
175
+ type: Boolean
176
+ },
177
+
137
178
isFullscreen: {
138
179
default: false ,
139
180
required: false ,
@@ -205,6 +246,7 @@ const terminal = computed(() => ({
205
246
dispatchedQueries: local .dispatchedQueries ,
206
247
history: local .history ,
207
248
historyPosition: local .historyPosition ,
249
+ invert: props .invert ,
208
250
isFullscreen: local .isFullscreen ,
209
251
prompt: local .prompt ,
210
252
query: local .query
@@ -429,6 +471,7 @@ provide('helpText', props.helpText)
429
471
provide (' helpTimeout' , props .helpTimeout )
430
472
provide (' hidePrompt' , props .hidePrompt )
431
473
provide (' incrementHistory' , incrementHistory)
474
+ provide (' invert' , props .invert )
432
475
provide (' optionsResolver' , props .optionsResolver )
433
476
provide (' parser' , props .parser )
434
477
provide (' programs' , programs)
@@ -456,8 +499,8 @@ defineExpose({
456
499
</script >
457
500
458
501
<style lang="scss">
459
- .vue-command {
460
- $seashell : #f1f1f1 ;
502
+ .vue-command ,
503
+ .vue-command--invert {
461
504
462
505
@mixin clearfix () {
463
506
@@ -475,17 +518,18 @@ defineExpose({
475
518
overflow-y : hidden ;
476
519
overflow-x : hidden ;
477
520
478
- .vue-command__bar {
521
+ .vue-command__bar ,
522
+ .vue-command__bar--invert {
479
523
@include clearfix ();
480
524
position : inherit ;
481
525
padding-left : 10px ;
482
526
padding-right : 10px ;
483
527
padding-top : 10px ;
484
528
padding-bottom : 10px ;
485
- background-color : #111316 ;
486
529
}
487
530
488
- .vue-command__bar__button {
531
+ .vue-command__bar__button ,
532
+ .vue-command__bar__button--invert {
489
533
display : inline-block ;
490
534
border-radius : 100% ;
491
535
@@ -501,31 +545,17 @@ defineExpose({
501
545
}
502
546
}
503
547
504
- .vue-command__bar__button--close {
505
- background-color : #ff5f58 ;
506
- }
507
-
508
- .vue-command__bar__button--minimize {
509
- background-color : #ffbd2e ;
510
- }
511
-
512
- .vue-command__bar__button--fullscreen {
513
- background-color : #29ca41 ;
514
- }
515
-
548
+ .vue-command__history--invert ,
516
549
.vue-command__history {
517
550
overflow : auto ;
518
551
word-break : break-all ;
519
- background-color : #111316 ;
520
552
display : block ;
521
553
padding : 12px 12px 12px 12px ;
522
554
margin : 0 ;
523
555
white-space : pre-line ;
524
556
line-height : 1.33 ;
525
- color : $seashell ;
526
557
font-size : 1rem ;
527
558
font-family : monospace ;
528
- color : #ffffff ;
529
559
height : 100% ;
530
560
531
561
/* Provide reasonable default values */
@@ -545,16 +575,83 @@ defineExpose({
545
575
font-size : 1rem ;
546
576
resize : none ;
547
577
overflow : hidden ;
578
+ }
579
+ }
580
+
581
+ .vue-command__history__entry--fullscreen {
582
+ height : 100% ;
583
+ }
584
+ }
585
+
586
+ .vue-command {
587
+ $seashell : #f1f1f1 ;
588
+
589
+ .vue-command__bar {
590
+ background-color : #111316 ;
591
+ }
592
+
593
+ .vue-command__bar__button--close {
594
+ background-color : #ff5f58 ;
595
+ }
596
+
597
+ .vue-command__bar__button--minimize {
598
+ background-color : #ffbd2e ;
599
+ }
600
+
601
+ .vue-command__bar__button--fullscreen {
602
+ background-color : #29ca41 ;
603
+ }
604
+
605
+ .vue-command__history {
606
+ background-color : #111316 ;
607
+ color : $seashell ;
608
+
609
+ /* Provide reasonable default values */
610
+ input ,
611
+ textarea {
612
+ background : none ;
548
613
color : #ffffff ;
549
614
550
615
& ::placeholder {
551
616
color : rgba (255 , 255 , 255 , 0.5 );
552
617
}
553
618
}
554
619
}
620
+ }
621
+
622
+ .vue-command--invert {
623
+ $seashell-invert : #0e0e0e ;
624
+
625
+ .vue-command__bar--invert {
626
+ background-color : #eeece9 ;
627
+ }
555
628
556
- .vue-command__history__entry--fullscreen {
557
- height : 100% ;
629
+ .vue-command__bar__button--close--invert {
630
+ background-color : #00a0a7 ;
631
+ }
632
+
633
+ .vue-command__bar__button--minimize--invert {
634
+ background-color : #0042d1 ;
635
+ }
636
+
637
+ .vue-command__bar__button--fullscreen--invert {
638
+ background-color : #d635be ;
639
+ }
640
+
641
+ .vue-command__history--invert {
642
+ background-color : #eeece9 ;
643
+ color : $seashell-invert ;
644
+
645
+ /* Provide reasonable default values */
646
+ input ,
647
+ textarea {
648
+ background : none ;
649
+ color : #000000 ;
650
+
651
+ & ::placeholder {
652
+ color : rgba (0 , 0 , 0 , 0.5 );
653
+ }
654
+ }
558
655
}
559
656
}
560
657
</style >
0 commit comments