-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Josh Black <[email protected]> Co-authored-by: Randall Krauskopf <[email protected]> Co-authored-by: Hussam Ghazzi <[email protected]>
- Loading branch information
1 parent
6713e72
commit 9a9d220
Showing
3 changed files
with
103 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react' | ||
import {Box, FormControl, Radio} from '..' | ||
|
||
export default { | ||
title: 'Components/Radio/Dev', | ||
component: Radio, | ||
} | ||
|
||
export const SxProp = () => { | ||
return ( | ||
<Box as="form"> | ||
<FormControl> | ||
<Radio name="default-radio-name" value="default" sx={{backgroundColor: 'red'}} /> | ||
<FormControl.Label>Label</FormControl.Label> | ||
</FormControl> | ||
</Box> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.Radio { | ||
border-radius: var(--borderRadius-full, 100vh); | ||
transition: | ||
background-color, | ||
border-color 80ms cubic-bezier(0.33, 1, 0.68, 1); /* checked -> unchecked - add 120ms delay to fully see animation-out */ | ||
|
||
&:checked { | ||
/* stylelint-disable-next-line primer/colors */ | ||
background-color: var(--control-checked-fgColor-rest); | ||
|
||
/* using bgColor here to avoid a border change in dark high contrast */ | ||
/* stylelint-disable-next-line primer/colors */ | ||
border-color: var(--control-checked-bgColor-rest); | ||
border-width: var(--borderWidth-thicker); | ||
|
||
&:disabled { | ||
cursor: not-allowed; | ||
/* stylelint-disable-next-line primer/colors */ | ||
background-color: var(--fgColor-muted); | ||
/* stylelint-disable-next-line primer/colors */ | ||
border-color: var(--fgColor-muted); | ||
} | ||
} | ||
|
||
&:focus, | ||
&:focus-within { | ||
@mixin focusOutline 2px; | ||
} | ||
|
||
@media (forced-colors: active) { | ||
background-color: canvastext; | ||
border-color: canvastext; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters