Const
This operator matches a SwiftUI view that uses a standard font modifier, like .font(.body). The operator creates mutations that replace the standard font modifier with a static font size modifier, which disables support for Dynamic Type.
.font(.body)
Before:
Text("Pineapple") .font(.body) Copy
Text("Pineapple") .font(.body)
After:
Text("Pineapple") .font(.system(size: 17)) Copy
Text("Pineapple") .font(.system(size: 17))
Applicable WCAG Success Criteria:
Related documentation:
This operator matches a SwiftUI view that uses a standard font modifier, like
.font(.body)
. The operator creates mutations that replace the standard font modifier with a static font size modifier, which disables support for Dynamic Type.Before:
After:
Applicable WCAG Success Criteria:
Related documentation: