Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
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 @@ -37,9 +37,13 @@ public struct WordPressAuthenticatorStyle {

public let disabledTitleColor: UIColor

/// Style: Subheadline
///
public let subheadlineColor: UIColor

/// Designated initializer
///
public init(primaryNormalBackgroundColor: UIColor, primaryNormalBorderColor: UIColor, primaryHighlightBackgroundColor: UIColor, primaryHighlightBorderColor: UIColor, secondaryNormalBackgroundColor: UIColor, secondaryNormalBorderColor: UIColor, secondaryHighlightBackgroundColor: UIColor, secondaryHighlightBorderColor: UIColor, disabledBackgroundColor: UIColor, disabledBorderColor: UIColor, primaryTitleColor: UIColor, secondaryTitleColor: UIColor, disabledTitleColor: UIColor) {
public init(primaryNormalBackgroundColor: UIColor, primaryNormalBorderColor: UIColor, primaryHighlightBackgroundColor: UIColor, primaryHighlightBorderColor: UIColor, secondaryNormalBackgroundColor: UIColor, secondaryNormalBorderColor: UIColor, secondaryHighlightBackgroundColor: UIColor, secondaryHighlightBorderColor: UIColor, disabledBackgroundColor: UIColor, disabledBorderColor: UIColor, primaryTitleColor: UIColor, secondaryTitleColor: UIColor, disabledTitleColor: UIColor, subheadlineColor: UIColor) {
self.primaryNormalBackgroundColor = primaryNormalBackgroundColor
self.primaryNormalBorderColor = primaryNormalBorderColor
self.primaryHighlightBackgroundColor = primaryHighlightBackgroundColor
Expand All @@ -53,6 +57,7 @@ public struct WordPressAuthenticatorStyle {
self.primaryTitleColor = primaryTitleColor
self.secondaryTitleColor = secondaryTitleColor
self.disabledTitleColor = disabledTitleColor
self.subheadlineColor = subheadlineColor
}
}

Expand All @@ -70,6 +75,7 @@ public extension WordPressAuthenticatorStyle {
disabledBorderColor: WPStyleGuide.greyLighten30(),
primaryTitleColor: UIColor.white,
secondaryTitleColor: WPStyleGuide.darkGrey(),
disabledTitleColor: WPStyleGuide.greyLighten30())
disabledTitleColor: WPStyleGuide.greyLighten30(),
subheadlineColor: WPStyleGuide.wordPressBlue())
}
}
2 changes: 2 additions & 0 deletions WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ final class SubheadlineButton: UIButton {
super.traitCollectionDidChange(previousTraitCollection)
if previousTraitCollection?.preferredContentSizeCategory != traitCollection.preferredContentSizeCategory {
titleLabel?.font = WPStyleGuide.mediumWeightFont(forStyle: .subheadline)
setTitleColor(WordPressAuthenticator.shared.style.subheadlineColor, for: .normal)
}
}
}
Expand Down Expand Up @@ -162,6 +163,7 @@ extension WPStyleGuide {
button.titleLabel?.font = font
button.titleLabel?.numberOfLines = 0
button.titleLabel?.lineBreakMode = .byWordWrapping
button.setTitleColor(WordPressAuthenticator.shared.style.subheadlineColor, for: .normal)

// These constraints work around some issues with multiline buttons and
// vertical layout. Without them the button's height may not account
Expand Down