Skip to content

Commit

Permalink
Cleanup Radio styling
Browse files Browse the repository at this point in the history
  • Loading branch information
domyen committed Jun 24, 2019
1 parent c133e3b commit 113b33e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/components/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import styled, { css } from 'styled-components';
import { rgba } from 'polished';
import { color, typography } from './shared/styles';

const RadioWrapper = styled.div`
display: flex;
align-items: center;
flex-wrap: wrap;
`;

const Label = styled.label`
cursor: pointer;
font-size: ${typography.size.s2}px;
Expand Down Expand Up @@ -54,17 +48,18 @@ const Description = styled.div`
font-weight: ${typography.weight.regular};
color: ${color.mediumdark};
margin-top: 4px;
margin-left: calc(${typography.size.s2}px + 0.4em);
width: 100%;
`;

const Input = styled.input.attrs({ type: 'radio' })`
margin: 0 0.6em 0 0;
margin: 0 0.4em 0 0;
font-size: initial;
opacity: 0;
& + ${LabelText} {
&:before,
&:after {
transition: all 150ms ease-out;
position: absolute;
top: 0;
left: 0;
Expand Down Expand Up @@ -93,6 +88,7 @@ const Input = styled.input.attrs({ type: 'radio' })`
}
& + ${LabelText}:after {
transition: all 150ms ease-out;
transform: scale3d(0, 0, 1);
height: 10px;
Expand All @@ -110,6 +106,12 @@ const Input = styled.input.attrs({ type: 'radio' })`
}
`;

const RadioWrapper = styled.div`
display: flex;
align-items: center;
flex-wrap: wrap;
`;

export function Radio({ id, label, description, error, hideLabel, value, className, ...props }) {
let errorId;
let descriptionId;
Expand Down

0 comments on commit 113b33e

Please sign in to comment.