Fixes button.secondaryBorder theme token discarded for secondary buttons#293241
Fixes button.secondaryBorder theme token discarded for secondary buttons#293241EmrecanKaracayir wants to merge 2 commits intomicrosoft:mainfrom
button.secondaryBorder theme token discarded for secondary buttons#293241Conversation
There was a problem hiding this comment.
Pull request overview
This pull request attempts to fix issue #293240 where the button.secondaryBorder theme token was not being used for secondary buttons. The issue reported that secondary buttons were incorrectly using the button.border theme token instead of button.secondaryBorder.
Changes:
- Added
buttonSecondaryBorderto the imports fromcolorRegistry.ts - Modified the
buttonBorderproperty mapping indefaultButtonStylesto usebuttonSecondaryBordertheme token
| buttonSecondaryBorder: asCssVariable(buttonSecondaryBorder), | ||
| buttonBorder: asCssVariable(buttonBorder), |
There was a problem hiding this comment.
The mapping between button border properties and theme tokens is incorrect. Both lines have the wrong theme tokens assigned:
- Line 54 maps
buttonSecondaryBorderproperty tobuttonBordertheme token, but it should map tobuttonSecondaryBordertheme token - Line 55 maps
buttonBorderproperty tobuttonSecondaryBordertheme token, but it should map tobuttonBordertheme token
According to button.ts lines 233-241, secondary buttons use the buttonSecondaryBorder property while primary buttons use the buttonBorder property. Following the pattern established for other button properties (where property names match theme token names), the correct mapping should be:
buttonSecondaryBorder: asCssVariable(buttonSecondaryBorder),
buttonBorder: asCssVariable(buttonBorder),
The current code will cause primary buttons to use the button.secondaryBorder theme token and secondary buttons to use the button.border theme token, which is the opposite of what's intended.
Fixes: #293240