vibetunnel/mac/VibeTunnel/Presentation/Utilities/CommonViewModifiers.swift
Peter Steinberger baaaa5a033 fix: CI and linting issues across all platforms
- Fix code signing in Mac and iOS test workflows
- Fix all SwiftFormat and SwiftLint issues
- Fix ESLint issues in web code
- Remove force casts and unwrapping in Swift code
- Update build scripts to use correct file paths
2025-06-23 19:40:53 +02:00

50 lines
1.2 KiB
Swift

import SwiftUI
// MARK: - View Extensions
extension View {
/// Applies standard padding used throughout the app.
///
/// - Parameters:
/// - horizontal: Horizontal padding (default: 16)
/// - vertical: Vertical padding (default: 14)
public func standardPadding(
horizontal: CGFloat = 16,
vertical: CGFloat = 14
)
-> some View
{
self
.padding(.horizontal, horizontal)
.padding(.vertical, vertical)
}
}
// MARK: - Previews
#Preview("Standard Padding") {
VStack(spacing: 16) {
HStack {
Text("Default Padding")
Spacer()
Text("16pt H, 14pt V")
.font(.caption)
.foregroundStyle(.secondary)
}
.standardPadding()
.background(Color.blue.opacity(0.1))
HStack {
Text("Custom Padding")
Spacer()
Text("24pt H, 20pt V")
.font(.caption)
.foregroundStyle(.secondary)
}
.standardPadding(horizontal: 24, vertical: 20)
.background(Color.green.opacity(0.1))
}
.padding()
.frame(width: 400)
.background(Color(NSColor.windowBackgroundColor))
}