Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button tokens was missing iOS File and had a typo in Default file #3238

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fixing some colortokens issues",
"packageName": "@fluentui-react-native/button",
"email": "[email protected]",
"dependentChangeType": "patch"
}
96 changes: 96 additions & 0 deletions packages/components/Button/src/ButtonColorTokens.ios.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import type { Theme } from '@fluentui-react-native/framework';
import type { TokenSettings } from '@fluentui-react-native/use-styling';

import type { ButtonTokens } from './Button.types';

export const defaultButtonColorTokens: TokenSettings<ButtonTokens, Theme> = (t: Theme) =>
({
backgroundColor: t.colors.buttonBackground,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a copy of the base ButtinColorTokens file? If so this file isn't necessary, it should pick up the base version if no override has been specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check that, I actually noticed this was missing and the bugs in the other one several weeks ago then forgot to go through with the check in so I'm resurecting it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do need iOS tokens, we should use Fluent tokens to specify the styling. The current colors listed here are older colors that aren't used in the Fluent2 system.

color: t.colors.buttonText,
borderColor: t.colors.buttonBorder,
iconColor: t.colors.buttonIcon,
disabled: {
backgroundColor: t.colors.defaultDisabledBackground,
color: t.colors.defaultDisabledContent,
borderColor: t.colors.defaultDisabledBorder,
iconColor: t.colors.defaultDisabledIcon,
},
hovered: {
backgroundColor: t.colors.defaultHoveredBackground,
color: t.colors.defaultHoveredContent,
borderColor: t.colors.defaultHoveredBorder,
iconColor: t.colors.defaultHoveredIcon,
},
pressed: {
backgroundColor: t.colors.defaultPressedBackground,
color: t.colors.defaultPressedContent,
borderColor: t.colors.defaultPressedBorder,
iconColor: t.colors.defaultPressedIcon,
},
focused: {
backgroundColor: t.colors.defaultFocusedBackground,
color: t.colors.defaultFocusedContent,
borderColor: t.colors.defaultFocusedBorder,
iconColor: t.colors.defaultFocusedIcon,
},
primary: {
backgroundColor: t.colors.brandedBackground,
color: t.colors.brandedContent,
borderColor: t.colors.brandedBorder,
iconColor: t.colors.brandedIcon,
disabled: {
backgroundColor: t.colors.brandedDisabledBackground,
color: t.colors.brandedDisabledContent,
borderColor: t.colors.brandedDisabledBorder,
iconColor: t.colors.brandedDisabledIcon,
},
hovered: {
backgroundColor: t.colors.brandedHoveredBackground,
color: t.colors.brandedHoveredContent,
borderColor: t.colors.brandedHoveredBorder,
iconColor: t.colors.brandedHoveredIcon,
},
pressed: {
backgroundColor: t.colors.brandedPressedBackground,
color: t.colors.brandedPressedContent,
borderColor: t.colors.brandedPressedBorder,
iconColor: t.colors.brandedPressedIcon,
},
focused: {
backgroundColor: t.colors.brandedFocusedBackground,
color: t.colors.brandedFocusedContent,
borderColor: t.colors.brandedFocusedBorder,
iconColor: t.colors.brandedFocusedIcon,
},
},
subtle: {
backgroundColor: t.colors.ghostBackground,
color: t.colors.ghostContent,
borderColor: t.colors.ghostBorder,
iconColor: t.colors.ghostIcon,
disabled: {
color: t.colors.ghostDisabledContent,
borderColor: t.colors.ghostDisabledBorder,
backgroundColor: t.colors.ghostDisabledBackground,
iconColor: t.colors.ghostDisabledIcon,
},
hovered: {
backgroundColor: t.colors.ghostHoveredBackground,
color: t.colors.ghostHoveredContent,
borderColor: t.colors.ghostHoveredBorder,
iconColor: t.colors.ghostHoveredIcon,
},
pressed: {
backgroundColor: t.colors.ghostPressedBackground,
borderColor: t.colors.ghostPressedBorder,
color: t.colors.ghostPressedContent,
iconColor: t.colors.ghostPressedIcon,
},
focused: {
borderColor: t.colors.ghostFocusedBorder,
backgroundColor: t.colors.ghostFocusedBackground,
color: t.colors.ghostFocusedContent,
iconColor: t.colors.ghostFocusedIcon,
},
},
} as ButtonTokens);
6 changes: 3 additions & 3 deletions packages/components/Button/src/ButtonColorTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const defaultButtonColorTokens: TokenSettings<ButtonTokens, Theme> = (t:
backgroundColor: t.colors.defaultFocusedBackground,
color: t.colors.defaultFocusedContent,
borderColor: t.colors.defaultFocusedBorder,
icon: t.colors.defaultFocusedIcon,
iconColor: t.colors.defaultFocusedIcon,
},
primary: {
backgroundColor: t.colors.brandBackground,
Expand Down Expand Up @@ -76,13 +76,13 @@ export const defaultButtonColorTokens: TokenSettings<ButtonTokens, Theme> = (t:
backgroundColor: t.colors.ghostPressedBackground,
borderColor: t.colors.ghostPressedBorder,
color: t.colors.ghostPressedContent,
icon: t.colors.ghostPressedIcon,
iconColor: t.colors.ghostPressedIcon,
},
focused: {
borderColor: t.colors.ghostFocusedBorder,
backgroundColor: t.colors.ghostFocusedBackground,
color: t.colors.ghostFocusedContent,
icon: t.colors.ghostFocusedIcon,
iconColor: t.colors.ghostFocusedIcon,
},
},
} as ButtonTokens);
Loading