Skip to content

Commit 56d2688

Browse files
MBL-2480: Fix showstopper dark mode design bugs (#2462)
* MBL-2480: Add brand/logo semantic color and use it for all logo views * MBL-2480: Use white as dark mode color for selected project navigation tab * MBL-2480: Set tab bar appearance to 'standard', with scroll edge This fixes a bug where the tab bar had a different appearance for different pages of the app.
1 parent 9b01497 commit 56d2688

File tree

9 files changed

+33
-10
lines changed

9 files changed

+33
-10
lines changed

Kickstarter-iOS/Features/DesignSystem/Controller/ColorsView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ struct ColorsView: View {
2424
Colors.Background.Inverse.disabled,
2525
Colors.Background.Surface.primary,
2626
Colors.Background.Surface.secondary,
27+
Colors.Brand.logo,
2728
Colors.Border.active,
2829
Colors.Border.bold,
2930
Colors.Border.subtle,
@@ -65,6 +66,7 @@ struct ColorsView: View {
6566
LegacyColors.Background.Action.primary,
6667
LegacyColors.Background.Action.Primary.disabled,
6768
LegacyColors.Background.Action.Primary.pressed,
69+
LegacyColors.Project.Navigation.selected,
6870
LegacyColors.Tags.Success.background,
6971
LegacyColors.Tags.Success.foreground,
7072
LegacyColors.Tags.Warn.background,
27.7 KB
Loading

Kickstarter-iOS/Features/Discovery/Views/Cells/DiscoveryOnboardingCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private let discoveryOnboardingTitleStyle: LabelStyle = { label in
6363
private let discoveryOnboardingLogoStyle: ImageViewStyle = { imageView in
6464
imageView
6565
|> \.contentMode .~ .scaleAspectFit
66-
|> \.tintColor .~ LegacyColors.ksr_create_500.uiColor()
66+
|> \.tintColor .~ Colors.Brand.logo.uiColor()
6767
|> \.backgroundColor .~ .clear
6868
|> UIImageView.lens.contentHuggingPriority(for: .vertical) .~ .required
6969
|> UIImageView.lens.contentCompressionResistancePriority(for: .vertical) .~ .required

Kickstarter-iOS/Features/HelpWeb/Controller/HelpWebViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal final class HelpWebViewController: WebViewController {
3232
super.bindStyles()
3333

3434
_ = self.logoImageView
35-
|> \.tintColor .~ LegacyColors.ksr_create_500.uiColor()
35+
|> \.tintColor .~ Colors.Brand.logo.uiColor()
3636
}
3737

3838
internal override func bindViewModel() {

Kickstarter-iOS/Features/LoginTout/Controller/LoginToutViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ private let baseLabelStyle: LabelStyle = { label in
521521
private let logoImageViewStyle: ImageViewStyle = { imageView in
522522
imageView
523523
|> \.image .~ image(named: "kickstarter-logo")?.withRenderingMode(.alwaysTemplate)
524-
|> \.tintColor .~ LegacyColors.ksr_create_500.uiColor()
524+
|> \.tintColor .~ Colors.Brand.logo.uiColor()
525525
|> \.contentMode .~ .scaleAspectFit
526526
|> \.translatesAutoresizingMaskIntoConstraints .~ false
527527
|> \.accessibilityLabel %~ { _ in Strings.general_accessibility_kickstarter() }

Kickstarter-iOS/Features/ProjectPage/Views/ProjectNavigationSelectorView.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ final class ProjectNavigationSelectorView: UIView {
178178
|> UIButton.lens.title(for: .normal) %~ { _ in section.displayString.uppercased() }
179179
|> UIButton.lens.accessibilityLabel %~ { _ in section.displayString }
180180
|> UIButton.lens.titleColor(for: .normal) %~ { _ in LegacyColors.ksr_support_400.uiColor() }
181-
|> UIButton.lens.titleColor(for: .selected) %~ { _ in LegacyColors.ksr_trust_500.uiColor() }
181+
|> UIButton.lens
182+
.titleColor(for: .selected) %~ { _ in LegacyColors.Project.Navigation.selected.uiColor() }
182183
|> UIButton.lens.titleLabel.font .~ UIFont.ksr_footnote().weighted(.semibold)
183184
|> UIButton.lens.titleLabel.textAlignment .~ .center
184185

@@ -304,7 +305,7 @@ final class ProjectNavigationSelectorView: UIView {
304305

305306
private let selectedButtonBorderViewStyle: ViewStyle = { view in
306307
view
307-
|> \.backgroundColor .~ LegacyColors.ksr_trust_500.uiColor()
308+
|> \.backgroundColor .~ LegacyColors.Project.Navigation.selected.uiColor()
308309
}
309310

310311
private let rootStackViewStyle: StackViewStyle = { stackView in

Kickstarter-iOS/SharedViews/SharedStoryboards/Main.storyboard

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="49e-Tb-3d3">
3-
<device id="retina4_7" orientation="portrait">
4-
<adaptation id="fullscreen"/>
5-
</device>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="49e-Tb-3d3">
3+
<device id="retina4_7" orientation="portrait" appearance="light"/>
64
<dependencies>
7-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
87
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
98
</dependencies>
109
<scenes>
@@ -17,6 +16,8 @@
1716
<rect key="frame" x="0.0" y="975" width="768" height="49"/>
1817
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
1918
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
19+
<tabBarAppearance key="standardAppearance"/>
20+
<tabBarAppearance key="scrollEdgeAppearance"/>
2021
</tabBar>
2122
</tabBarController>
2223
<placeholder placeholderIdentifier="IBFirstResponder" id="HuB-VB-40B" sceneMemberID="firstResponder"/>

Library/Styles/Colors/LegacyColors.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,14 @@ public struct LegacyColors {
190190
)
191191
}
192192
}
193+
194+
public struct Project {
195+
public struct Navigation {
196+
public static let selected = LegacyColor(
197+
"legacy/project/navigation/selected",
198+
lightMode: UIColor.hex(0x5555FF),
199+
darkMode: UIColor(coreColor: .white)
200+
)
201+
}
202+
}
193203
}

Library/Styles/Colors/NewDesignSystemColors.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ public struct Colors {
229229
}
230230
}
231231

232+
public struct Brand {
233+
/// Kickstarter brand green. Inverts to the same brand color in dark mode.
234+
public static let logo = SemanticColor(
235+
"brand/logo",
236+
lightMode: .green_05,
237+
darkMode: .green_05
238+
)
239+
}
240+
232241
public struct Border {
233242
public static let active = SemanticColor(
234243
"border/active",

0 commit comments

Comments
 (0)