diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2026-06-18 22:05:21 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <jj@r.bdr.sh> | 2026-06-18 22:06:01 +0200 |
| commit | cb91a73bfc845d74c3e4d1115bce5dfed10d456d (patch) | |
| tree | 62d218c4ec13f742b5de10ff442f46d152716658 /Sources/NorgUI/Theme/NorgTheme.swift | |
| parent | 3c391974907820c6385e90025faeab0d9c60bd06 (diff) | |
Make spacings configurable1.1.0
Diffstat (limited to 'Sources/NorgUI/Theme/NorgTheme.swift')
| -rw-r--r-- | Sources/NorgUI/Theme/NorgTheme.swift | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Sources/NorgUI/Theme/NorgTheme.swift b/Sources/NorgUI/Theme/NorgTheme.swift index 47dd161..c788812 100644 --- a/Sources/NorgUI/Theme/NorgTheme.swift +++ b/Sources/NorgUI/Theme/NorgTheme.swift @@ -32,6 +32,14 @@ public struct NorgTheme: Sendable { public var codeFont: Font /// Horizontal indentation applied per nesting level. public var indentWidth: CGFloat + /// Vertical spacing between the label and contents of a verbatim block. + public var verbatimLeadingSpace: CGFloat + /// Padding applied around the contents of a verbatim block. + public var verbatimPadding: CGFloat + /// Vertical spacing between sibling blocks and nodes. + public var blockSpacing: CGFloat + /// Padding applied above a heading. + public var headingTopPadding: CGFloat /// Tint for a task's status symbol. public var statusTint: @Sendable (TaskStatus) -> Color /// SF Symbol name for a task's status symbol. @@ -56,6 +64,10 @@ public struct NorgTheme: Sendable { codeBackground: AnyShapeStyle, codeFont: Font, indentWidth: CGFloat, + verbatimLeadingSpace: CGFloat = 4, + verbatimPadding: CGFloat = 10, + blockSpacing: CGFloat = 10, + headingTopPadding: CGFloat = 4, statusTint: @escaping @Sendable (TaskStatus) -> Color, statusSymbol: @escaping @Sendable (TaskStatus) -> String, statusLabel: @escaping @Sendable (TaskStatus) -> LocalizedStringResource = { $0.displayName } @@ -74,6 +86,10 @@ public struct NorgTheme: Sendable { self.codeBackground = codeBackground self.codeFont = codeFont self.indentWidth = indentWidth + self.verbatimLeadingSpace = verbatimLeadingSpace + self.verbatimPadding = verbatimPadding + self.blockSpacing = blockSpacing + self.headingTopPadding = headingTopPadding self.statusTint = statusTint self.statusSymbol = statusSymbol self.statusLabel = statusLabel |