Commit 0296ca08 authored by Randall Leeds's avatar Randall Leeds

Flexbox to the rescue

Lay out the search bar and the top bar using flexbox because the
vertical centering is much better and easier using flexbox instead
of floats and line heights.

As long as we're using only features easily supported in the 2012
and final spec the -ms prefix gets us IE10. All other browsers we
care about should be supported already by the compass mixins.
parent 5a54b3b4
@import 'compass/css3/flexbox';
@import "base.scss"; @import "base.scss";
@import "mixins/icons"; @import "mixins/icons";
.simple-search-form { .simple-search-form {
@include clearfix; @include display-flex;
@include flex-flow(row nowrap);
/* IE10 support */
display: -ms-flexbox;
-ms-flex-flow: row nowrap;
position: relative; position: relative;
padding: 0 2em;
color: $gray-dark; color: $gray-dark;
} }
.simple-search-icon { .simple-search-icon {
position: absolute; @include order(0);
left: 0;
top: 0;
} }
:not(:focus) ~ .simple-search-icon { :not(:focus) ~ .simple-search-icon {
...@@ -19,16 +24,18 @@ ...@@ -19,16 +24,18 @@
} }
input.simple-search-input { input.simple-search-input {
outline: none; @include flex-grow(1);
@include order(1);
/* IE10 support */
-ms-flex: 1;
-ms-flex-order: 1;
color: $text-color; color: $text-color;
width: 100%;
border: none; border: none;
outline: none;
padding: 0; padding: 0;
.simple-search-inactive &:not(:focus) {
border-color: #f3f3f3;
}
&:disabled { &:disabled {
background: none; background: none;
color: $gray-light; color: $gray-light;
......
@import 'compass/css3/flexbox';
@import 'base'; @import 'base';
@import 'mixins/responsive'; @import 'mixins/responsive';
...@@ -6,31 +8,44 @@ ...@@ -6,31 +8,44 @@
border: solid 1px $gray-lighter; border: solid 1px $gray-lighter;
border-style: solid none; border-style: solid none;
height: 30px; height: 30px;
font-size: 14px;
position: fixed; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
top: 0; top: 0;
z-index: 5; z-index: 5;
}
.inner { .topbar .inner {
* { @include display-flex;
font-size: 14px; @include flex-flow(row nowrap);
line-height: 28px; @include align-items(center);
@include justify-content(space-between);
.btn-icon { /* IE10 support */
font-size: 18px; display: -ms-flexbox;
} -ms-flex-align: center;
} -ms-flex-flow: row nowrap;
-ms-flex-pack: justify;
height: 28px;
@include respond-to(wide-handhelds handhelds) { @include respond-to(wide-handhelds handhelds) {
margin: 0 .72em; margin: 0 .36em;
}
} }
} }
.topbar .inner > * {
margin-left: .36em;
}
.topbar .inner .simple-search {
@include flex-grow(1);
-ms-flex: 1; /* IE10 support */
}
.topbar .btn { .topbar .btn {
color: $gray-light; color: $gray-light;
height: 28px;
min-width: 28px; min-width: 28px;
border: 0; border: 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment