Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(lsg): add styling to property boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilman Frick committed Dec 15, 2017
1 parent 5f5602c commit 0bc168d
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions src/lsg/patterns/property-items/boolean-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,53 +20,58 @@ const StyledBooleanItem = styled.div`
`;

const StyledLabelWrapper = styled.label`
display: flex;
justify-content: space-between;
align-items: center;
display: block;
margin-bottom: ${getSpace(Size.XXL)}px;
`;

const indicatorWidth = 18;
const indicatorHeight = 8;
const indicatorWidth = 42;
const indicatorHeight = 24;
const indicatorBorderWidth = 1;

const StyledIndicator = styled.span`
position: relative;
display: inline-block;
display: block;
width: ${indicatorWidth}px;
height: ${indicatorHeight}px;
border-radius: 5px;
border-radius: ${indicatorHeight/2}px;
background: ${colors.grey90.toString()};
box-sizing: border-box;
border: ${indicatorBorderWidth}px solid transparent;
box-shadow: 0 0 0 ${indicatorBorderWidth}px ${colors.grey70.toString()};
&::after {
box-shadow: inset 0 0 0 ${indicatorBorderWidth}px ${colors.grey70.toString()};
&:after {
content: '';
display: block;
width: 6px;
height: 6px;
width: ${indicatorHeight}px;
height: ${indicatorHeight}px;
border: ${indicatorBorderWidth}px solid ${colors.grey70.toString()};
transform: translateX(0px);
border-radius: 100%;
background: ${colors.grey70.toString()};
transition: transform ease-in-out 0.5s;
background: ${colors.white.toString()};
transition: all ease-in-out 0.25s;
box-sizing: border-box;
}
${(props: IndicatorProps) =>
props.checked
? `
background: ${colors.blue.toString()};
border-color: ${colors.blue.toString()};
box-shadow: 0 0 0 ${indicatorBorderWidth}px ${colors.blue.toString()};
&::after {
transform: translateX(${indicatorWidth / 2 + indicatorBorderWidth}px);
box-shadow: inset 0 0 0 ${indicatorBorderWidth}px ${colors.blue.toString()};
&:after {
transform: translateX(${indicatorWidth - indicatorHeight}px);
background: ${colors.white.toString()};
border-color: ${colors.blue.toString()};
}
`
: ''};
`;

const StyledLabel = styled.span`
font-size: 14px;
display: block;
font-size: 12px;
font-family: ${fonts().NORMAL_FONT};
color: ${colors.grey70.toString()};
text-transform: capitalize;
margin-bottom: ${getSpace(Size.XS)}px;
`;

const StyledInput = styled.input`
Expand Down

0 comments on commit 0bc168d

Please sign in to comment.