-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathFontStyle+Weights.swift
71 lines (62 loc) · 2.35 KB
/
FontStyle+Weights.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// FontStyle+Weights.swift
//
// Made with ❤️ by Novum
//
// Copyright © Telefonica. All rights reserved.
//
import SwiftUI
import UIKit
public extension FontStyle {
enum TextPreset1Weight: CaseIterable {
case regular, medium, cardTitle, title1, indicator
var value: MisticaFontWeightType {
switch self {
case .regular: return .regular
case .medium: return .medium
case .cardTitle: return MisticaConfig.currentFontWeights.cardTitle
case .title1: return MisticaConfig.currentFontWeights.title1
case .indicator: return MisticaConfig.currentFontWeights.indicator
}
}
}
enum TextPreset2Weight: CaseIterable {
case regular, medium, button, indicator, link, tabsLabel
var value: MisticaFontWeightType {
switch self {
case .regular: return .regular
case .medium: return .medium
case .button: return MisticaConfig.currentFontWeights.button
case .indicator: return MisticaConfig.currentFontWeights.indicator
case .link: return MisticaConfig.currentFontWeights.link
case .tabsLabel: return MisticaConfig.currentFontWeights.tabsLabel
}
}
}
enum TextPreset3Weight: CaseIterable {
case light, regular, medium, button, link, title2, title3
var value: MisticaFontWeightType {
switch self {
case .light: return .light
case .regular: return .regular
case .medium: return .medium
case .button: return MisticaConfig.currentFontWeights.button
case .link: return MisticaConfig.currentFontWeights.link
case .title2: return MisticaConfig.currentFontWeights.title2
case .title3: return MisticaConfig.currentFontWeights.title3
}
}
}
enum TextPreset4Weight: CaseIterable {
case light, regular, medium, cardTitle, navigationBar
var value: MisticaFontWeightType {
switch self {
case .light: return .light
case .regular: return .regular
case .medium: return .medium
case .cardTitle: return MisticaConfig.currentFontWeights.cardTitle
case .navigationBar: return MisticaConfig.currentFontWeights.navigationBar
}
}
}
}