Cotton code
31 lines · 1.0 KB · SwiftRaw
// The screen's horizontal margin, and the one spelling of it.import SwiftUIextension View {    /// **The screen's horizontal margin — and the one spelling of it.**    ///    /// It is `.padding(.horizontal, ContentMarginKnobs.chromeContentMargin)`:    /// the worn theme's content margin, where list text, separators and the    /// editor title begin. Write this rather than the padding.    public func cottonContentMargin() -> some View {        modifier(CottonContentMargin())    }}/// `cottonContentMargin()`, reading the worn theme's margin.private struct CottonContentMargin: ViewModifier {    @Environment(\.theme) private var theme    func body(content: Content) -> some View {        content            .padding(.horizontal, ContentMarginKnobs.chromeContentMargin)    }}/// The sizes, counts and timings the content margin draws with: Swift's own,/// beside their reader — a theme sets only its tokens (`scale.tokens`).enum ContentMarginKnobs {    static let chromeContentMargin: CGFloat = 29}