File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
packages/bezier-react/src
components/Forms/RadioGroup Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 22import * as RadioGroupPrimitive from '@radix-ui/react-radio-group'
33
44/* Internal dependencies */
5- import { styled , Typography } from 'Foundation'
5+ import { styled , css , Typography } from 'Foundation'
66import DisabledOpacity from 'Constants/DisabledOpacity'
7+ import { touchableHover } from 'Utils/styleUtils'
78import { Text } from 'Components/Text'
89import { FormFieldSize } from 'Components/Forms'
910import { focusedInputWrapperStyle } from 'Components/Forms/Inputs/mixins'
@@ -68,15 +69,15 @@ export const RadioGroupPrimitiveItem = styled(RadioGroupPrimitive.Item)<RadioPro
6869 }
6970 }
7071
71- &:hover {
72+ ${ touchableHover ( css `
7273 & : not ([data-disabled ])[data-state = 'checked' ]::before {
7374 background-color : var (--bgtxt-green-dark );
7475 }
7576
7677 & : not ([data-disabled ]): not ([data-state = 'checked' ])::after {
7778 background-color : var (--bg-black-dark );
7879 }
79- }
80+ ` ) }
8081
8182 &:focus-visible {
8283 &::before {
Original file line number Diff line number Diff line change @@ -99,3 +99,19 @@ export function gap(spacing: number): InjectedInterpolation {
9999 }
100100 `
101101}
102+
103+ export function touchableHover ( interpolation : InjectedInterpolation ) : InjectedInterpolation {
104+ return css `
105+ @media (hover : hover) {
106+ & : hover {
107+ ${ interpolation }
108+ }
109+ }
110+
111+ @media (hover : none) {
112+ & : active {
113+ ${ interpolation }
114+ }
115+ }
116+ `
117+ }
You can’t perform that action at this time.
0 commit comments