diff --git a/VDS/Typography/Typography.swift b/VDS/Typography/Typography.swift index 1853c1f0..70f0601b 100644 --- a/VDS/Typography/Typography.swift +++ b/VDS/Typography/Typography.swift @@ -65,10 +65,10 @@ public enum TextStyle: String, CaseIterable { //MARK: FontCategory extension TextStyle { public enum FontCategory: String, CaseIterable { - case feature = "Feature" - case title = "Title" - case body = "Body" - case micro = "micro" + case feature + case title + case body + case micro public var sizes: [FontSize] { switch self { @@ -84,7 +84,13 @@ extension TextStyle { } public func style(for fontSize: FontSize?, isBold: Bool = false) -> TextStyle? { - let styleName = "\(isBold ? "Bold" : "")\(self.rawValue)\(fontSize?.rawValue ?? "")" + var styleName = "" + if isBold { + let newRaw = rawValue.prefix(1).description.uppercased() + rawValue.dropFirst() + styleName = "\(isBold ? "bold" : "")\(newRaw)\(fontSize?.rawValue ?? "")" + } else { + styleName = "\(newRaw)\(fontSize?.rawValue ?? "")" + } guard let style = TextStyle(rawValue: styleName) else { return nil }