@@ -3,6 +3,7 @@ import { unit } from '@ant-design/cssinjs';
33import { FastColor } from '@ant-design/fast-color' ;
44
55import { genFocusStyle , resetComponent } from '../../style' ;
6+ import { genNoMotionStyle } from '../../style/motion' ;
67import type { FullToken , GenerateStyle , GetDefaultToken } from '../../theme/internal' ;
78import { genStyleHooks , mergeToken } from '../../theme/internal' ;
89
@@ -208,6 +209,7 @@ const genSwitchHandleStyle: GenerateStyle<SwitchToken, CSSObject> = (token) => {
208209 width : handleSize ,
209210 height : handleSize ,
210211 transition : `all ${ token . switchDuration } ease-in-out` ,
212+ ...genNoMotionStyle ( ) ,
211213
212214 '&::before' : {
213215 position : 'absolute' ,
@@ -220,6 +222,7 @@ const genSwitchHandleStyle: GenerateStyle<SwitchToken, CSSObject> = (token) => {
220222 boxShadow : handleShadow ,
221223 transition : `all ${ token . switchDuration } ease-in-out` ,
222224 content : '""' ,
225+ ...genNoMotionStyle ( ) ,
223226 } ,
224227 } ,
225228
@@ -270,7 +273,7 @@ const genSwitchInnerStyle: GenerateStyle<SwitchToken, CSSObject> = (token) => {
270273 transition : [ `padding-inline-start` , `padding-inline-end` ]
271274 . map ( ( prop ) => `${ prop } ${ switchDuration } ease-in-out` )
272275 . join ( ', ' ) ,
273-
276+ ... genNoMotionStyle ( ) ,
274277 [ `${ switchInnerCls } -checked, ${ switchInnerCls } -unchecked` ] : {
275278 display : 'block' ,
276279 color : token . colorTextLightSolid ,
@@ -280,6 +283,7 @@ const genSwitchInnerStyle: GenerateStyle<SwitchToken, CSSObject> = (token) => {
280283 transition : [ `margin-inline-start` , `margin-inline-end` ]
281284 . map ( ( prop ) => `${ prop } ${ switchDuration } ease-in-out` )
282285 . join ( ', ' ) ,
286+ ...genNoMotionStyle ( ) ,
283287 } ,
284288
285289 [ `${ switchInnerCls } -checked` ] : {
@@ -347,7 +351,7 @@ const genSwitchStyle = (token: SwitchToken): CSSObject => {
347351 cursor : 'pointer' ,
348352 transition : `all ${ token . motionDurationMid } ` ,
349353 userSelect : 'none' ,
350-
354+ ... genNoMotionStyle ( ) ,
351355 [ `&:hover:not(${ componentCls } -disabled)` ] : {
352356 background : token . colorTextTertiary ,
353357 } ,
0 commit comments