87 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-10-03 12:58:20 +02:00
import styled, { css } from 'styled-components';
2019-09-17 16:20:45 +02:00
const Wrapper = styled.div`
margin-bottom: 0.5rem;
padding-left: 0;
font-size: 13px;
2019-09-18 17:39:54 +02:00
div {
2019-09-17 16:20:45 +02:00
height: 26px;
padding-left: 15px;
line-height: 26px;
2019-11-19 16:17:15 +01:00
i,
svg {
2019-09-18 17:39:54 +02:00
display: none;
2019-09-17 16:20:45 +02:00
position: absolute;
top: 8px;
right: 10px;
color: #787e8f;
cursor: pointer;
}
2019-10-03 12:58:20 +02:00
${({ value }) => {
if (value) {
return css`
&:hover {
2019-11-19 16:17:15 +01:00
> i,
> svg {
2019-10-03 12:58:20 +02:00
display: block;
}
}
`;
}
}}
2019-09-18 17:39:54 +02:00
&.highlighted {
border-radius: 3px;
background-color: #e9eaeb;
font-weight: 600;
}
&.highlighted,
&.is-checked:hover {
2019-11-19 16:17:15 +01:00
> i,
> svg {
2019-09-18 17:39:54 +02:00
display: block;
}
}
2019-09-17 16:20:45 +02:00
}
`;
const Label = styled.label`
margin-left: 9px;
cursor: pointer;
> input {
display: none;
margin-right: 9px;
}
&:before {
content: '';
position: absolute;
left: 15px;
top: 6px;
width: 14px;
height: 14px;
border: 1px solid rgba(16, 22, 34, 0.15);
background-color: #fdfdfd;
border-radius: 3px;
}
&.checked {
&:after {
content: '\f00c';
position: absolute;
top: 0;
left: 17px;
font-size: 10px;
font-family: 'FontAwesome';
color: #1c5de7;
transition: all 0.2s;
}
2019-11-19 16:17:15 +01:00
&:hover {
& + i,
& + svg {
display: block;
}
}
2019-09-17 16:20:45 +02:00
}
`;
export { Label, Wrapper };