diff --git a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift index ba073cd8f..164ea6f55 100644 --- a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift +++ b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorStyles.swift @@ -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 @@ -53,6 +57,7 @@ public struct WordPressAuthenticatorStyle { self.primaryTitleColor = primaryTitleColor self.secondaryTitleColor = secondaryTitleColor self.disabledTitleColor = disabledTitleColor + self.subheadlineColor = subheadlineColor } } @@ -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()) } } diff --git a/WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift b/WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift index 80da569ca..a1bf4b77a 100644 --- a/WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift +++ b/WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift @@ -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) } } } @@ -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