HighlightSwift
HighlightSwift copied to clipboard
Added `.codeFont(_:)` modifier
Updated modifiers to support a .codeFont(_:) custom attribute. Disabled monospaced design if font is set custom.
These changes are well implemented, however I think they might be redundant.
Standard SwiftUI view modifiers can be applied to CodeText to override the font design back to .default and then set the font to one of the environment-dependent Font options. Notably, the order of these two modifiers does matter. For example:
struct HeadlineCodeText: View {
let text: String
var body: some View {
CodeText(text)
.fontDesign(.default)
.font(.headline)
}
}
Let me know if this is sufficient for your use case. If not, we could still consider merging this.