Skip to content

Commit

Permalink
refactor :: font의 size를 정하는 것을 더욱 protocol oriented하게.
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Sep 21, 2022
1 parent aa04a28 commit 0976662
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ public enum DMSFontStyle {
}
}

// MARK: - Title
public extension DMSFontStyle.Title {
// MARK: - FontableSize
extension DMSFontable where Self: RawRepresentable, Self.RawValue == CGFloat {
var size: CGFloat {
self.rawValue
}
}

// MARK: - Title
public extension DMSFontStyle.Title {
var weight: Font.Weight {
switch self {
case .extraLarge, .large, .medium, .extraSmall:
Expand All @@ -47,10 +50,6 @@ public extension DMSFontStyle.Title {

// MARK: - Text
public extension DMSFontStyle.Text {
var size: CGFloat {
self.rawValue
}

var weight: Font.Weight {
switch self {
case .twoExtraLarge, .extraLarge, .large, .medium, .small, .extraSmall, .twoExtraSmall:
Expand Down

0 comments on commit 0976662

Please sign in to comment.