mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 23:53:42 +08:00
Collapse search input on tablets. closes flarum/core#162
While this solution isn't perfect (perhaps a search icon which opens a dropdown would be better, like Discourse does) - it'll do for now :)
This commit is contained in:
parent
abd6da73f5
commit
3911139b17
|
@ -77,6 +77,7 @@ export default class Search extends Component {
|
||||||
return (
|
return (
|
||||||
<div className={'Search ' + classList({
|
<div className={'Search ' + classList({
|
||||||
open: this.value() && this.hasFocus,
|
open: this.value() && this.hasFocus,
|
||||||
|
focused: this.hasFocus,
|
||||||
active: !!currentSearch,
|
active: !!currentSearch,
|
||||||
loading: !!this.loadingSources
|
loading: !!this.loadingSources
|
||||||
})}>
|
})}>
|
||||||
|
|
|
@ -266,6 +266,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media @tablet {
|
||||||
|
.Header-secondary .Search {
|
||||||
|
input {
|
||||||
|
width: 1px;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
&:not(.active) input {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
// Content Area
|
// Content Area
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,11 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@media @tablet-up {
|
@media @tablet-up {
|
||||||
.Search {
|
.Search.focused {
|
||||||
input:focus, &.active input, .Search-results {
|
margin-left: -400px;
|
||||||
|
.transition(all 0.4s);
|
||||||
|
|
||||||
|
input, .Search-results {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,9 +54,9 @@
|
||||||
input {
|
input {
|
||||||
float: left;
|
float: left;
|
||||||
width: 225px;
|
width: 225px;
|
||||||
padding-left: 36px;
|
padding-left: 32px;
|
||||||
padding-right: 36px;
|
padding-right: 32px;
|
||||||
.transition(~"all 0.4s");
|
.transition(all 0.4s);
|
||||||
}
|
}
|
||||||
.Button {
|
.Button {
|
||||||
float: left;
|
float: left;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user