Skip to content

Commit

Permalink
[www] Fix showcase search, checkbox styles (gatsbyjs#7014)
Browse files Browse the repository at this point in the history
* Fix some styling on the showcase page

* Better search input style

* Better aligned checkbox

* No outline for focused search input
  • Loading branch information
alexandernanberg authored and porfirioribeiro committed Aug 20, 2018
1 parent fec14c5 commit 4b9a6b4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
31 changes: 28 additions & 3 deletions www/src/views/shared/styles.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { options, /* rhythm, scale, */ rhythm } from "../../utils/typography"
import typography, { options, rhythm } from "../../utils/typography"
import presets, { colors } from "../../utils/presets"
import { style } from "glamor"
import hex2rgba from "hex2rgba"

const { curveDefault, speedDefault } = presets.animation

const styles = {
featuredSitesCard: style({
display: `flex`,
Expand Down Expand Up @@ -94,9 +96,9 @@ const styles = {
sticky: {
paddingTop: rhythm(options.blockMarginBottom),
position: `sticky`,
top: 0,
top: `calc(${presets.bannerHeight} - 1px)`,
[presets.Desktop]: {
top: `calc(${presets.headerHeight} - 1px)`,
top: `calc(${presets.headerHeight} + ${presets.bannerHeight} - 1px)`,
},
},
scrollbar: {
Expand Down Expand Up @@ -132,6 +134,29 @@ const styles = {
borderBottom: `none !important`, // i know i know
boxShadow: `none !important`, // but people really want this
},
searchInput: {
appearance: `none`,
backgroundColor: `transparent`,
border: 0,
borderRadius: presets.radiusLg,
color: colors.gatsby,
paddingTop: rhythm(1 / 8),
paddingRight: rhythm(1 / 4),
paddingBottom: rhythm(1 / 8),
paddingLeft: rhythm(1),
overflow: `hidden`,
fontFamily: typography.options.headerFontFamily.join(`,`),
transition: `width ${speedDefault} ${curveDefault}, background-color ${speedDefault} ${curveDefault}`,
width: `6.8rem`,
"&::placeholder": {
color: colors.lilac,
},
"&:focus": {
outline: "none",
width: `9rem`,
background: colors.ui.light,
},
},
}

export default styles
6 changes: 5 additions & 1 deletion www/src/views/showcase/collapsible-filter-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ const CollapsibleFilterList = ({
marginRight: 8,
}}
>
{filters.includes(c) ? <MdCheckbox /> : <MdCheckboxBlank />}
{filters.includes(c) ? (
<MdCheckbox style={{ verticalAlign: `-0.125em` }} />
) : (
<MdCheckboxBlank style={{ verticalAlign: `-0.125em` }} />
)}
</div>
<div
css={{
Expand Down
6 changes: 4 additions & 2 deletions www/src/views/showcase/filtered-showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class FilteredShowcase extends Component {
<label css={{ position: `relative` }}>
<input
css={{ ...styles.searchInput }}
type="text"
type="search"
value={this.state.search}
onChange={e =>
this.setState({
Expand Down Expand Up @@ -211,7 +211,9 @@ class FilteredShowcase extends Component {
}}
>
Load More
<MdArrowDownward style={{ marginLeft: 4 }} />
<MdArrowDownward
style={{ marginLeft: 4, verticalAlign: `sub` }}
/>
</button>
)}
</div>
Expand Down

0 comments on commit 4b9a6b4

Please sign in to comment.