We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0107f9 commit aaa935cCopy full SHA for aaa935c
Sources/SwiftCrossUI/Modifiers/FontModifier.swift
@@ -1,8 +1,22 @@
1
extension View {
2
public func font(_ font: Font) -> some View {
3
EnvironmentModifier(self) { environment in
4
- // TODO: Merge fonts?
5
environment.with(\.font, font)
6
}
7
+
8
+ public func bold() -> some View {
9
+ EnvironmentModifier(self) { environment in
10
+ let font =
11
+ switch environment.font {
12
+ case let .system(size, _, design):
13
+ Font.system(size: size, weight: .bold, design: design)
14
+ }
15
16
+ return environment.with(
17
+ \.font,
18
+ font
19
+ )
20
21
22
0 commit comments