This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct ColorScale<Color: ColorType>: ColorProvider { | |
public var lighttest: Color { | |
transformHandler("lighttest") | |
} | |
public var light: Color { | |
transformHandler("light") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct ColorVariant<Provider: ColorProvider>: ColorProvider { | |
public typealias Color = Provider.Color | |
public var xs: Provider { | |
transformHandler("xs") | |
} | |
public var md: Provider { | |
transformHandler("md") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct ImageSpace<Provider: ImageProvider>: ImageProvider { | |
public typealias Image = Provider.Image | |
public var acessibility: AcessibilityCategory<Provider> { | |
AcessibilityCategory { | |
transformHandler("accessibility.\($0)") | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
Text("Hello World!") | |
.foregroundColor(.ds.primary.medium) | |
.font(.arial.medium.xxxl) | |
.lineSpacing(.medium) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIColor: ColorType { | |
public static var ds: DSColors<UIColor> { | |
DSColors { literal in | |
UIColor( | |
name: literal, | |
in: .module, | |
compatibleWith: nil | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct DSColors<Color: ColorType>: ColorProvider { | |
public var primary: ColorScale<Color> { | |
ColorScale { | |
transformHandler("primary.\(%0)") | |
} | |
} | |
public var complementary: ColorStyle<Color> { | |
ColorStyle { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum Shadow { | |
case level1 | |
case level2 | |
case level3 | |
} | |
internal extension Shadow { | |
var x: CGFloat { ... } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UIKit | |
extension CALayer { | |
public func setShadow(_ level: Shadow) { | |
shadowRadius = level.radius | |
shadowOpacity = level.opacity | |
shadowColor = level.uiColor.cgFloat | |
shadowOffset = .init( | |
width: level.x, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Spacing<Number: Numeric> { | |
public var small: Number { | |
32 | |
} | |
public var medium: Number { | |
64 | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Double { | |
public static var spacing: Spacing<Self> { | |
Spacing() | |
} | |
} |
OlderNewer