Skip to content

Commit

Permalink
Refactor FXIOS-8712 Update design tokens and related UI
Browse files Browse the repository at this point in the history
  • Loading branch information
cyndichin committed Mar 27, 2024
1 parent 87d63ba commit 412ed91
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions BrowserKit/Sources/Common/Theming/DarkTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ private struct DarkColourPalette: ThemeColourPalette {
// MARK: - Actions
var actionPrimary: UIColor = FXColors.Blue30
var actionPrimaryHover: UIColor = FXColors.Blue20
var actionSecondary: UIColor = FXColors.LightGrey30
var actionSecondaryHover: UIColor = FXColors.LightGrey20
var actionSecondary: UIColor = FXColors.DarkGrey05
var actionSecondaryHover: UIColor = FXColors.LightGrey90
var formSurfaceOff: UIColor = FXColors.DarkGrey05
var formKnob: UIColor = FXColors.White
var indicatorActive: UIColor = FXColors.LightGrey90
Expand Down
4 changes: 2 additions & 2 deletions BrowserKit/Sources/Common/Theming/PrivateModeTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ private struct PrivateModeColorPalette: ThemeColourPalette {
// MARK: - Actions
var actionPrimary: UIColor = FXColors.Blue30
var actionPrimaryHover: UIColor = FXColors.Blue20
var actionSecondary: UIColor = FXColors.LightGrey30
var actionSecondaryHover: UIColor = FXColors.LightGrey20
var actionSecondary: UIColor = FXColors.DarkGrey05
var actionSecondaryHover: UIColor = FXColors.LightGrey90
var formSurfaceOff: UIColor = FXColors.DarkGrey05
var formKnob: UIColor = FXColors.White
var indicatorActive: UIColor = FXColors.LightGrey90
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class SecondaryRoundedButton: ResizableButton, ThemeApplicable {
public func applyTheme(theme: Theme) {
highlightedBackgroundColor = theme.colors.actionSecondaryHover
normalBackgroundColor = theme.colors.actionSecondary
foregroundColor = theme.colors.textOnLight
foregroundColor = theme.colors.textPrimary

setNeedsUpdateConfiguration()
}
Expand Down
4 changes: 1 addition & 3 deletions firefox-ios/Client/Frontend/Autofill/LoginCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct LoginCellView: View {
@State private var textColor: Color = .clear
@State private var customLightGray: Color = .clear
@State private var iconPrimary: Color = .clear
@State private var stroke: Color = .clear

private(set) var login: EncryptedLogin
@Environment(\.themeType)
Expand Down Expand Up @@ -72,7 +71,6 @@ struct LoginCellView: View {
textColor = Color(color.textPrimary)
customLightGray = Color(color.textSecondary)
iconPrimary = Color(color.iconPrimary)
stroke = Color(color.actionSecondary)
}
}

Expand All @@ -91,7 +89,7 @@ struct LoginButtonStyle: ButtonStyle {
style: .continuous
)
.stroke(style: StrokeStyle())
.foregroundColor(Color(theme.colors.actionSecondary))
.foregroundColor(.clear)
)
.clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous))
}
Expand Down
2 changes: 1 addition & 1 deletion firefox-ios/Client/Frontend/Browser/FindInPageBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class FindInPageBar: UIView, ThemeApplicable {
let colors = theme.colors
topBorder.backgroundColor = colors.borderPrimary
searchText.textColor = theme.type == .light ? colors.textPrimary : colors.textInverted
matchCountView.textColor = colors.actionSecondary
matchCountView.textColor = colors.textSecondary
previousButton.setTitleColor(colors.iconPrimary, for: .normal)
nextButton.setTitleColor(colors.iconPrimary, for: .normal)
closeButton.setTitleColor(colors.iconPrimary, for: .normal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class IntroViewController: UIViewController,
view.backgroundColor = theme.colors.layer2

pageControl.currentPageIndicatorTintColor = theme.colors.actionPrimary
pageControl.pageIndicatorTintColor = theme.colors.actionSecondary
pageControl.pageIndicatorTintColor = theme.colors.formSurfaceOff

viewModel.availableCards.forEach { $0.applyTheme() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class UpdateViewController: UIViewController,
!viewModel.shouldShowSingleCard
else { return }
pageControl.currentPageIndicatorTintColor = theme.colors.actionPrimary
pageControl.pageIndicatorTintColor = theme.colors.actionSecondary
pageControl.pageIndicatorTintColor = theme.colors.formSurfaceOff
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct SettingDisclosureUtility {
disclosureIndicator.image = UIImage(
named: StandardImageIdentifiers.Large.chevronRight
)?.withRenderingMode(.alwaysTemplate).imageFlippedForRightToLeftLayoutDirection()
disclosureIndicator.tintColor = theme.colors.actionSecondary
disclosureIndicator.tintColor = theme.colors.iconSecondary
disclosureIndicator.sizeToFit()
return disclosureIndicator
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class LockButton: UIButton {
extension LockButton: ThemeApplicable {
func applyTheme(theme: Theme) {
selectedTintColor = theme.colors.actionPrimary
disabledTintColor = theme.colors.actionSecondary
disabledTintColor = theme.colors.iconDisabled
unselectedTintColor = theme.colors.textPrimary
tintColor = isEnabled ? unselectedTintColor : disabledTintColor
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class OneLineTableViewCell: UITableViewCell,
backgroundColor = theme.colors.layer5
titleLabel.textColor = theme.colors.textPrimary
bottomSeparatorView.backgroundColor = theme.colors.borderPrimary
accessoryView?.tintColor = theme.colors.actionSecondary
accessoryView?.tintColor = theme.colors.iconSecondary
leftImageView.tintColor = theme.colors.textPrimary
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class TwoLineImageOverlayCell: UITableViewCell,
titleLabel.textColor = theme.colors.textPrimary
descriptionLabel.textColor = theme.colors.textSecondary
leftImageView.layer.borderColor = theme.colors.borderPrimary.cgColor
accessoryView?.tintColor = theme.colors.actionSecondary
accessoryView?.tintColor = theme.colors.iconSecondary
topSeparatorView.backgroundColor = theme.colors.borderPrimary
bottomSeparatorView.backgroundColor = theme.colors.borderPrimary
}
Expand Down

0 comments on commit 412ed91

Please sign in to comment.