@@ -22,9 +22,7 @@ import {
22
22
import Tooltip from '../internal/components/tooltip/index.js' ;
23
23
import { useButtonContext } from '../internal/context/button-context' ;
24
24
import { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context' ;
25
- import { SYSTEM } from '../internal/environment' ;
26
25
import { fireCancelableEvent , isPlainLeftClick } from '../internal/events' ;
27
- import customCssProps from '../internal/generated/custom-css-properties' ;
28
26
import useForwardFocus from '../internal/hooks/forward-focus' ;
29
27
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component' ;
30
28
import useHiddenDescription from '../internal/hooks/use-hidden-description' ;
@@ -36,6 +34,7 @@ import InternalLiveRegion from '../live-region/internal';
36
34
import { GeneratedAnalyticsMetadataButtonFragment } from './analytics-metadata/interfaces' ;
37
35
import { ButtonIconProps , LeftIcon , RightIcon } from './icon-helper' ;
38
36
import { ButtonProps } from './interfaces' ;
37
+ import { getButtonStyles } from './style' ;
39
38
40
39
import analyticsSelectors from './analytics-metadata/styles.css.js' ;
41
40
import styles from './styles.css.js' ;
@@ -292,41 +291,7 @@ export const InternalButton = React.forwardRef(
292
291
</ >
293
292
) ;
294
293
295
- const stylePropertiesAndVariables =
296
- SYSTEM === 'core'
297
- ? {
298
- borderRadius : style ?. root ?. borderRadius ,
299
- borderWidth : style ?. root ?. borderWidth ,
300
- paddingBlock : style ?. root ?. paddingBlock ,
301
- paddingInline : style ?. root ?. paddingInline ,
302
- ...( style ?. root ?. background && {
303
- [ customCssProps . styleBackgroundActive ] : style . root . background ?. active ,
304
- [ customCssProps . styleBackgroundDefault ] : style . root . background ?. default ,
305
- [ customCssProps . styleBackgroundDisabled ] : style . root . background ?. disabled ,
306
- [ customCssProps . styleBackgroundHover ] : style . root . background ?. hover ,
307
- } ) ,
308
- ...( style ?. root ?. borderColor && {
309
- [ customCssProps . styleBorderColorActive ] : style . root . borderColor ?. active ,
310
- [ customCssProps . styleBorderColorDefault ] : style . root . borderColor ?. default ,
311
- [ customCssProps . styleBorderColorDisabled ] : style . root . borderColor ?. disabled ,
312
- [ customCssProps . styleBorderColorHover ] : style . root . borderColor ?. hover ,
313
- } ) ,
314
- ...( style ?. root ?. color && {
315
- [ customCssProps . styleColorActive ] : style . root . color ?. active ,
316
- [ customCssProps . styleColorDefault ] : style . root . color ?. default ,
317
- [ customCssProps . styleColorDisabled ] : style . root . color ?. disabled ,
318
- [ customCssProps . styleColorHover ] : style . root . color ?. hover ,
319
- } ) ,
320
- ...( style ?. root ?. focusRing && {
321
- [ customCssProps . styleFocusRingBorderColor ] : style . root . focusRing ?. borderColor ,
322
- [ customCssProps . styleFocusRingBorderRadius ] : style . root . focusRing ?. borderRadius ,
323
- [ customCssProps . styleFocusRingBorderWidth ] : style . root . focusRing ?. borderWidth ,
324
- } ) ,
325
- ...( style ?. root ?. focusRing ?. borderRadius && {
326
- [ customCssProps . styleFocusRingBorderRadius ] : style . root . focusRing . borderRadius ,
327
- } ) ,
328
- }
329
- : undefined ;
294
+ const stylePropertiesAndVariables = getButtonStyles ( style ) ;
330
295
331
296
if ( isAnchor ) {
332
297
const getAnchorTabIndex = ( ) => {
0 commit comments