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

Add ability to customize TabBarView's separator color #1924

Merged
merged 1 commit into from
Nov 3, 2023
Merged
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
Expand Up @@ -251,6 +251,10 @@ extension TabBarViewDemoController: DemoAppearanceDelegate {
lightHighContrast: GlobalTokens.sharedColor(.teal, .tint40),
dark: GlobalTokens.sharedColor(.pumpkin, .tint40),
darkHighContrast: GlobalTokens.sharedColor(.burgundy, .tint40))
},
.separatorColor: .uiColor {
return UIColor(light: GlobalTokens.sharedColor(.red, .shade10),
dark: GlobalTokens.sharedColor(.red, .tint40))
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions ios/FluentUI/Tab Bar/TabBarTokenSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public class TabBarTokenSet: ControlTokenSet<TabBarTokenSet.Tokens> {
/// Font info for the title label when in landscape view.
case tabBarItemTitleLabelFontLandscape

/// Defines the color of the top separator.
case separatorColor

}

init() {
Expand Down Expand Up @@ -48,6 +51,9 @@ public class TabBarTokenSet: ControlTokenSet<TabBarTokenSet.Tokens> {
assertionFailure("TabBarItem tokens are placeholders and should not be read.")
return theme.typography(.body1)
}

case .separatorColor:
return .uiColor { theme.color(.stroke2) }
}
}
}
Expand Down
1 change: 1 addition & 0 deletions ios/FluentUI/Tab Bar/TabBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,6 @@ open class TabBarView: UIView, TokenizedControlInternal {
forToken: .titleLabelFontLandscape)
}
}
topBorderLine.tokenSet[.color] = tokenSet[.separatorColor]
}
}