Fix search box overlapping forum title in some cases. closes #697

- Fix jank in shrinking animation when search box loses focus after overlapping forum title.
- Use solid colors instead of transparent whites/blacks for colored header controls so that search box isn't transparent when it does overlap forum title.
- This also simplifies colored header variables, making them more analogous to the non-colored header variables, and allowing for the removal of some conditional CSS in the notifications dropdown button.

Some more radical changes to header layout (flexbox?) may be made when we implement the new mobile design (#867), but for now this is an acceptable fix.
This commit is contained in:
Toby Zerner 2016-03-28 10:23:49 +10:30
parent 537725e89d
commit ee00920032
4 changed files with 18 additions and 21 deletions

View File

@ -24,11 +24,6 @@
} }
} }
.NotificationsDropdown .Dropdown-toggle .Button-icon {
& when (@config-colored-header = true) {
color: mix(@header-bg, @header-color);
}
}
.NotificationsDropdown .Dropdown-toggle.new .Button-icon { .NotificationsDropdown .Dropdown-toggle.new .Button-icon {
color: @header-color; color: @header-color;
} }
@ -37,7 +32,7 @@
position: absolute; position: absolute;
top: 1px; top: 1px;
left: 17px; left: 17px;
background: @control-color; background: @header-control-color;
color: @header-bg; color: @header-bg;
font-size: 11px; font-size: 11px;
font-weight: bold; font-weight: bold;
@ -49,10 +44,6 @@
height: 18px; height: 18px;
text-align: center; text-align: center;
& when (@config-colored-header = true) {
background: mix(@header-bg, @header-color);
}
@media @phone { @media @phone {
left: 20px; left: 20px;
} }

View File

@ -2,12 +2,15 @@
position: relative; position: relative;
} }
@media @tablet-up { @media @tablet-up {
.Search.focused { .Search {
margin-left: -400px; .transition(margin-left 0.4s);
.transition(all 0.4s);
input, .Search-results { &.focused {
width: 400px; margin-left: -400px;
input, .Search-results {
width: 400px;
}
} }
} }
} }

View File

@ -1,18 +1,21 @@
// This is a mixin which styles components (buttons, inputs, etc.) for use on // This is a mixin which styles components (buttons, inputs, etc.) for use on
// dark backgrounds. // dark backgrounds.
.light-contents(@color: #fff, @control-bg: fade(#000, 10%), @control-color: #fff) { .light-contents(@color: #fff, @control-bg: fade(#000, 10%), @control-color: #fff) {
&, a, .Button--link, .Search-input { &, a {
color: @color; color: @color;
} }
.Button--link, .Search-input {
color: @control-color;
}
.FormControl { .FormControl {
background: @control-bg; background: @control-bg;
border: 0; border: 0;
color: @control-color; color: @control-color;
.placeholder(fade(@control-color, 80%)); .placeholder(@control-color);
&:focus { &:focus {
color: @control-color; color: @color;
background: fadein(@control-bg, 5%); background: fadein(darken(@control-bg, 5%), 10%);
} }
} }
.Button, .Button:hover { .Button, .Button:hover {

View File

@ -81,8 +81,8 @@
.define-header(true) { .define-header(true) {
@header-bg: @primary-color; @header-bg: @primary-color;
@header-color: @body-bg; @header-color: @body-bg;
@header-control-bg: fade(#000, 10%); @header-control-bg: mix(#000, @header-bg, 10%);
@header-control-color: @body-bg; @header-control-color: mix(@body-bg, @header-bg, 60%);
} }
// --------------------------------- // ---------------------------------