11<template >
22 <div
33 ref =" vueCommandRef"
4- class =" vue-command" >
4+ :class =" {
5+ 'vue-command': !invert,
6+ 'vue-command--invert': invert
7+ }" >
58 <slot name =" bar" >
69 <div
710 v-if =" !hideBar"
8- class =" vue-command__bar" >
11+ :class =" {
12+ 'vue-command__bar': !invert,
13+ 'vue-command__bar--invert': invert
14+ }" >
915 <!-- 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 >
1340 </div >
1441 </slot >
1542
1643 <div
1744 ref =" vueCommandHistoryRef"
18- class =" vue-command__history"
45+ :class =" {
46+ 'vue-command__history': !invert,
47+ 'vue-command__history--invert': invert
48+ }"
1949 @click =" autoFocus" >
2050 <div
2151 v-for =" (component, index) in local.history"
2252 v-show =" shouldShowHistoryEntry(index)"
2353 :key =" index"
2454 :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)
2759 }" >
2860 <!-- User given components like bash and query -->
2961 <component
3062 :is =" component"
3163 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+ }" />
3368 </div >
3469 </div >
3570 </div >
@@ -134,6 +169,12 @@ const props = defineProps({
134169 type: Number
135170 },
136171
172+ invert: {
173+ default: false ,
174+ required: false ,
175+ type: Boolean
176+ },
177+
137178 isFullscreen: {
138179 default: false ,
139180 required: false ,
@@ -205,6 +246,7 @@ const terminal = computed(() => ({
205246 dispatchedQueries: local .dispatchedQueries ,
206247 history: local .history ,
207248 historyPosition: local .historyPosition ,
249+ invert: props .invert ,
208250 isFullscreen: local .isFullscreen ,
209251 prompt: local .prompt ,
210252 query: local .query
@@ -429,6 +471,7 @@ provide('helpText', props.helpText)
429471provide (' helpTimeout' , props .helpTimeout )
430472provide (' hidePrompt' , props .hidePrompt )
431473provide (' incrementHistory' , incrementHistory)
474+ provide (' invert' , props .invert )
432475provide (' optionsResolver' , props .optionsResolver )
433476provide (' parser' , props .parser )
434477provide (' programs' , programs)
@@ -456,8 +499,8 @@ defineExpose({
456499 </script >
457500
458501<style lang="scss">
459- .vue-command {
460- $seashell : #f1f1f1 ;
502+ .vue-command ,
503+ .vue-command--invert {
461504
462505 @mixin clearfix () {
463506
@@ -475,17 +518,18 @@ defineExpose({
475518 overflow-y : hidden ;
476519 overflow-x : hidden ;
477520
478- .vue-command__bar {
521+ .vue-command__bar ,
522+ .vue-command__bar--invert {
479523 @include clearfix ();
480524 position : inherit ;
481525 padding-left : 10px ;
482526 padding-right : 10px ;
483527 padding-top : 10px ;
484528 padding-bottom : 10px ;
485- background-color : #111316 ;
486529 }
487530
488- .vue-command__bar__button {
531+ .vue-command__bar__button ,
532+ .vue-command__bar__button--invert {
489533 display : inline-block ;
490534 border-radius : 100% ;
491535
@@ -501,31 +545,17 @@ defineExpose({
501545 }
502546 }
503547
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 ,
516549 .vue-command__history {
517550 overflow : auto ;
518551 word-break : break-all ;
519- background-color : #111316 ;
520552 display : block ;
521553 padding : 12px 12px 12px 12px ;
522554 margin : 0 ;
523555 white-space : pre-line ;
524556 line-height : 1.33 ;
525- color : $seashell ;
526557 font-size : 1rem ;
527558 font-family : monospace ;
528- color : #ffffff ;
529559 height : 100% ;
530560
531561 /* Provide reasonable default values */
@@ -545,16 +575,83 @@ defineExpose({
545575 font-size : 1rem ;
546576 resize : none ;
547577 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 ;
548613 color : #ffffff ;
549614
550615 & ::placeholder {
551616 color : rgba (255 , 255 , 255 , 0.5 );
552617 }
553618 }
554619 }
620+ }
621+
622+ .vue-command--invert {
623+ $seashell-invert : #0e0e0e ;
624+
625+ .vue-command__bar--invert {
626+ background-color : #eeece9 ;
627+ }
555628
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+ }
558655 }
559656}
560657 </style >
0 commit comments