import styled from '@emotion/styled'; import { IColors } from '../../types/theme'; export const StyledCheckbox = styled.label( ({ theme: colors, width, disabled, }: { theme: IColors; width: number; disabled: boolean; }) => ` display: block; position: relative; padding-left: ${width + 5}px; min-width:8px; margin-bottom:0 !important; cursor: ${disabled ? 'default' : 'pointer'}; font-size: 22px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; div{ color: ${colors.tx_text_primary}; font-family: Montserrat; font-style: normal; font-weight: normal; display:flex; align-items: center; } .M{ font-size: 16px; line-height: ${width + 2}px; } .S{ font-size: 14px; line-height: ${width + 2}px; } input{ // position: absolute; opacity: 0; cursor: ${disabled ? 'default' : 'pointer'}; height: 0; width: 0; } .checkmark { position: absolute; top: 0; left: 0; height: ${width}px; width: ${width}px; background-color: ${colors.bg_background_fields}; border-radius:2px; border: 1px solid ${colors.bg_background_fields}; } &:hover input ~ .checkmark { border: 1px solid ${disabled ? 'transparent' : colors.bg_border_primary}; } input:checked ~ .checkmark { // background-color: #2196F3; } .checkmark:after { content: ""; position: absolute; display: none; } input:checked ~ .checkmark:after { display: block; } .checkmark:after { color:${colors.bg_text_primary}; height: 100%; width: 100%; background-image: url("data:image/svg+xml;charset=utf-8,"); content: ""; } .error{ border: 1px solid ${colors.bg_error}; } .error:hover { border: 1px solid ${colors.bg_error} !important; } ` ); export const StyleCheckLabel = styled.div( ({ theme: colors, isActive }: { theme: IColors; isActive: boolean }) => ` font-family: Montserrat; font-style: normal; font-weight: normal; cursor:pointer; font-size: 16px; line-height: 20px; margin:8px 0; margin-left:8px; text-transform:capitalize; min-width:28px; display:flex; justify-content:center; align-items:center; color: ${isActive ? colors.tx_white : colors.tx_text_teriaty}; padding:4px 6px; background: ${ isActive ? colors.bg_text_primary : colors.bg_background_primary }; border-radius: 2px; ` );