#if canImport(UIKit) || canImport(AppKit) import SwiftUI private struct NorgEditorThemeKey: EnvironmentKey { static let defaultValue = EditorTheme.default } /// Makes NorgTheme values accessible via the environment. extension EnvironmentValues { public var norgEditorTheme: EditorTheme { get { self[NorgEditorThemeKey.self] } set { self[NorgEditorThemeKey.self] = newValue } } } extension View { public func norgEditorTheme(_ theme: EditorTheme) -> some View { environment(\.norgEditorTheme, theme) } } #endif