Skip to content

Commit

Permalink
Use alternate colours at Hd breakpoint on home page
Browse files Browse the repository at this point in the history
  • Loading branch information
m-allanson committed Feb 1, 2018
1 parent e3a9655 commit 42c20b2
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions www/src/components/search-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ class SearchForm extends Component {

render() {
const { enabled, focussed } = this.state
const { iconStyles } = this.props
const { iconStyles, isHomepage } = this.props

return enabled ? (
<form
css={{
Expand Down Expand Up @@ -337,8 +338,19 @@ class SearchForm extends Component {
},

[presets.Desktop]: {
backgroundColor: `#fff`,
width: rhythm(5),
backgroundColor: !isHomepage && `#fff`,
color: colors.gatsby,
width: !isHomepage && rhythm(5),
":focus": {
backgroundColor: colors.ui.light,
color: colors.gatsby,
},
},

[presets.Hd]: {
backgroundColor: isHomepage && colors.lilac,
color: isHomepage && colors.ui.light,
width: isHomepage && rhythm(5),
},
}}
type="search"
Expand All @@ -354,18 +366,18 @@ class SearchForm extends Component {
<SearchIcon
overrideCSS={{
...iconStyles,
fill: focussed && colors.gatsby,
position: `absolute`,
left: `5px`,
top: `50%`,
width: `16px`,
height: `16px`,
fill: focussed ? presets.brandLight : false,
pointerEvents: `none`,
transition: `fill ${speedDefault} ${curveDefault}`,
transform: `translateY(-50%)`,

[presets.Desktop]: {
fill: presets.brandLight,
[presets.Hd]: {
fill: focussed && isHomepage && colors.gatsby,
},
}}
/>
Expand All @@ -376,6 +388,7 @@ class SearchForm extends Component {
}

SearchForm.propTypes = {
isHomepage: PropTypes.bool,
iconStyles: PropTypes.object,
}

Expand Down

0 comments on commit 42c20b2

Please sign in to comment.