Skip to content

Commit

Permalink
fix(Input): More style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenfitzpatrick committed Mar 20, 2018
1 parent d070486 commit dce5c3a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
18 changes: 9 additions & 9 deletions src/components/Input/Input.styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import { spacing } from '../../styles/spacing';
const FormField = styled.label`
position: relative;
display: block;
margin-bottom: ${spacing.xl};
margin-bottom: ${spacing.xxxxxl};
${errorMixin};
`;

const FormError = styled.span`
position: absolute;
display: block;
color: ${colors.errorActive};
font-size: ${font.m};
margin-top: ${spacing.s};
`;

const FitzyLabel = styled.label`
Expand Down Expand Up @@ -46,7 +46,6 @@ const FitzyInput = styled.input`
background-color: transparent;
border: none;
border: 1px solid transparent;
border-bottom: 1px solid ${p => p.theme.Input.border};
color: #fff;
transition: border 0.3s ease-in-out;
Expand All @@ -57,19 +56,20 @@ const FitzyInput = styled.input`
opacity: ${p => (p.value ? 1 : 0)};
}
&::-webkit-input-placeholder {
color: ${p => p.theme.Input.placeholder};
}
&:-webkit-autofill {
-webkit-box-shadow: 0 0 0 30px white inset;
-webkit-text-fill-color: yellow !important;
-webkit-box-shadow: 0 0 0 30px ${colors.bgColor} inset;
-webkit-text-fill-color: ${colors.light} !important;
~ label {
transform: translateY(-${spacing.xxxxl});
opacity: 1;
}
}
&::-webkit-input-placeholder {
color: ${p => p.theme.Input.placeholder};
}
&:focus {
border-bottom: 1px solid ${p => p.theme.Input.borderActive};
outline: none;
Expand Down
16 changes: 8 additions & 8 deletions src/components/Input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ initialState = {
onChange={(_, v) => setState({ password: v })}
required
/>
<Input
label="Name"
placeholder="Enter your name"
name="name"
value={state.name}
onChange={(_, v) => setState({ name: v })}
required
/>
<Input
label="Email"
placeholder="Enter your email"
Expand All @@ -55,6 +47,14 @@ initialState = {
warning={<span>Invalid Email</span>}
required
/>
<Input
label="Name"
placeholder="Enter your name"
name="name"
value={state.name}
onChange={(_, v) => setState({ name: v })}
required
/>
</div>;
```

Expand Down
3 changes: 2 additions & 1 deletion src/styles/spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export const spacing = {
xl: '1.5rem',
xxl: '1.75rem',
xxxl: '2rem',
xxxxl: '2.25rem'
xxxxl: '2.25rem',
xxxxxl: '2.5rem'
};
2 changes: 2 additions & 0 deletions src/theme/theme.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { setThemeColors } from './utils';

export const colors = {
// Background colors
bgColor: '#172025',
// Shadow Colors
textShadowDark: '0 1px 2px rgba(0, 0, 0, 0.2)',
boxShadowDark: 'hsla(0, 0%, 0%, 0.2)',
Expand Down

0 comments on commit dce5c3a

Please sign in to comment.