From c54c3d963ecf03fc5f306260d2bcc092e1e8e482 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 9 Jan 2019 22:15:09 -0800 Subject: [PATCH] Increase accessibility of search input --- app/scenes/Search/components/SearchField.js | 36 ++++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/app/scenes/Search/components/SearchField.js b/app/scenes/Search/components/SearchField.js index 5d6d7e3c..a6697b9d 100644 --- a/app/scenes/Search/components/SearchField.js +++ b/app/scenes/Search/components/SearchField.js @@ -1,5 +1,6 @@ // @flow import * as React from 'react'; +import { lighten } from 'polished'; import styled, { withTheme } from 'styled-components'; import { SearchIcon } from 'outline-icons'; import Flex from 'shared/components/Flex'; @@ -22,11 +23,11 @@ class SearchField extends React.Component { render() { return ( - + { type="search" autoFocus /> - + ); } } +const Field = styled(Flex)` + position: relative; + margin-bottom: 8px; +`; + const StyledInput = styled.input` width: 100%; - padding: 10px; - font-size: 48px; + padding: 10px 10px 10px 60px; + font-size: 36px; font-weight: 400; outline: none; border: 0; + background: ${props => props.theme.smoke}; + border-radius: 4px; + + ::-webkit-search-cancel-button { + -webkit-appearance: searchfield-cancel-button; + } ::-webkit-input-placeholder { - color: ${props => props.theme.slateLight}; + color: ${props => props.theme.slate}; } :-moz-placeholder { - color: ${props => props.theme.slateLight}; + color: ${props => props.theme.slate}; } ::-moz-placeholder { - color: ${props => props.theme.slateLight}; + color: ${props => props.theme.slate}; } :-ms-input-placeholder { - color: ${props => props.theme.slateLight}; + color: ${props => props.theme.slate}; } `; const StyledIcon = styled(SearchIcon)` - position: relative; - top: 4px; + position: absolute; + left: 8px; `; export default withTheme(SearchField);