Implement Math view
This commit is contained in:
18
Sources/SwiftUIMath/TypesettingStyle.swift
Normal file
18
Sources/SwiftUIMath/TypesettingStyle.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
import SwiftUI
|
||||
|
||||
extension Math {
|
||||
public enum TypesettingStyle: Sendable {
|
||||
case display
|
||||
case text
|
||||
}
|
||||
}
|
||||
|
||||
extension View {
|
||||
public func mathTypesettingStyle(_ typesettingStyle: Math.TypesettingStyle) -> some View {
|
||||
environment(\.mathTypesettingStyle, typesettingStyle)
|
||||
}
|
||||
}
|
||||
|
||||
extension EnvironmentValues {
|
||||
@Entry var mathTypesettingStyle: Math.TypesettingStyle = .display
|
||||
}
|
||||
Reference in New Issue
Block a user