diff --git a/src/components/inputs/Checkbox/Checkbox.story.tsx b/src/components/inputs/Checkbox/Checkbox.story.tsx index ec788367..64d8598d 100755 --- a/src/components/inputs/Checkbox/Checkbox.story.tsx +++ b/src/components/inputs/Checkbox/Checkbox.story.tsx @@ -5,6 +5,8 @@ import { Checkbox, Props } from './Checkbox'; import { Layout } from '../../../storybook'; +import styled from 'styled-components'; + export default { title: 'components/Checkbox', component: Checkbox, @@ -32,10 +34,44 @@ export default { }, }; +const StyledCheck = styled(Checkbox)` + // input { + // &:checked ~ div[type='checkbox'] { + // border: 1px solid black; + // &::after { + // border-color: black; + // background-color: black; + // } + // } + // } + --checked-color: black; +`; + const Template: Story = (args) => { return ( + + + + + ); }; diff --git a/src/components/inputs/Input/Input.style.ts b/src/components/inputs/Input/Input.style.ts index 36f1dc3f..1eaaf060 100755 --- a/src/components/inputs/Input/Input.style.ts +++ b/src/components/inputs/Input/Input.style.ts @@ -59,7 +59,10 @@ export const HiddenMark: StyledComponent< function fauxMarkChecked({ disabled }) { return css` &:checked ~ ${Faux} { - border: 1px solid ${rgba(blue(500), disabled ? 0 : 1)}; + border-style: solid; + border-width: 1px; + ${!disabled && + `border-color: var(--checked-color, ${blue(500)})`}; &:after { opacity: ${disabled ? 0.5 : 1}; @@ -148,7 +151,7 @@ export function FauxType({ type, size }) { &:after { width: 100%; height: 100%; - border: 1px solid ${blue(500)}; + border: 1px solid var(--checked-color, ${blue(500)}); background-image: ${checkmark}; } `; diff --git a/src/components/inputs/Shared.ts b/src/components/inputs/Shared.ts index c5991845..e6511300 100755 --- a/src/components/inputs/Shared.ts +++ b/src/components/inputs/Shared.ts @@ -159,7 +159,7 @@ export const FauxMark = (type, mirror) => &:after { content: ''; display: block; - background: ${blue(500)}; + background: var(--checked-color, ${blue(500)}); opacity: 0; transition: 200ms ease-in-out; transform: scale(0);