More consistent color scheme and usage

Only show search by click on search icon (desktop as well)
Improved color scheme
Keep search open search page
This commit is contained in:
Nachtalb 2021-04-13 00:55:57 +02:00
parent 3fb9c8523a
commit 13d4f035df
No known key found for this signature in database
GPG Key ID: E48DF13C07055D92
2 changed files with 40 additions and 31 deletions

View File

@ -12,6 +12,7 @@
/>
</div>
<button
v-if="!onSearchPage"
class="search"
type="button"
aria-label="Search messages in this channel"
@ -29,27 +30,22 @@ form.message-search .input-wrapper {
display: flex;
}
form.message-search button {
display: none !important;
}
form.message-search input {
width: 100%;
height: auto !important;
margin: 7px 0;
border: 0;
color: inherit;
background-color: rgba(128, 128, 128, 0.15);
background-color: #fafafa;
}
form.message-search input::placeholder {
color: rgba(128, 128, 128, 0.4);
color: rgba(0, 0, 0, 0.35);
}
@media (min-width: 480px) {
form.message-search input {
min-width: 140px;
transition: min-width 0.2s;
}
form.message-search input:focus {
@ -57,7 +53,6 @@ form.message-search input::placeholder {
}
}
@media (max-width: 768px) {
form.message-search .input-wrapper {
position: absolute;
top: 45px;
@ -65,7 +60,6 @@ form.message-search input::placeholder {
right: 0;
z-index: 1;
height: 0;
transition: height 0.2s;
overflow: hidden;
background: var(--window-bg-color);
}
@ -78,9 +72,9 @@ form.message-search input::placeholder {
height: 50px;
}
form.message-search button {
display: flex !important;
}
#chat form.message-search button {
display: flex;
color: #607992;
}
</style>
@ -97,6 +91,11 @@ export default {
searchInput: "",
};
},
computed: {
onSearchPage() {
return this.$route.name === "SearchResults";
},
},
watch: {
"$route.query.q"() {
this.searchInput = this.$route.query.q;
@ -104,10 +103,13 @@ export default {
},
mounted() {
this.searchInput = this.$route.query.q;
this.searchOpened = this.onSearchPage;
},
methods: {
closeSearch() {
if (!this.onSearchPage) {
this.searchOpened = false;
}
},
toggleSearch() {
if (this.searchOpened) {
@ -125,8 +127,6 @@ export default {
return;
}
this.searchOpened = false;
this.$router
.push({
name: "SearchResults",

View File

@ -118,6 +118,15 @@ body {
color: #b7c5d1;
}
/* Search Form */
form.message-search input {
background-color: #28333d;
}
#chat form.message-search button {
color: #b7c5d1;
}
/* Setup text colors */
#chat .msg[data-type="error"],
#chat .msg[data-type="error"] .from {