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
// --snip-- | |
renderView = AnyView(configuration.label | |
.background(backgroundColor!) | |
.frame(width: iconSize!.rawValue, height: iconSize!.rawValue, alignment: .center) | |
.clipShape(RoundedRectangle(cornerRadius: iconSize!.rawValue)) | |
.overlay(RoundedRectangle(cornerRadius: iconSize!.rawValue) | |
.stroke(borderStyle!.color, lineWidth: borderStyle!.width)) | |
) |
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
// buttonLabel modifier | |
struct TokenButtonLabel: View { | |
// --snip-- | |
/// State properties | |
var isHighlighted = false | |
// --snip-- | |
} | |
extension TokenButtonLabel { |
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
#if DEBUG | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
.environment(\.font, Font.Typography.mainFont) | |
.environment(\.colorScheme, .dark) | |
} | |
} | |
#endif |
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
struct TokenColor { | |
// --snip-- | |
// see here for more: https://gist.github.com/vince19972/70eee7d66735739aa31567efd7a0a475 | |
} | |
struct TokenTypography { | |
// --snip-- | |
// see here for more: https://gist.github.com/vince19972/8ff8635bdb7bfdf54b85ab711b55f634l | |
} | |
// extend from native `Color` and `Font` struct |
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
struct BaseColor { | |
/// dynamic color sets (with dark and light mode) | |
let contrastPrimary = Color("contrastPrimary") | |
let themePrimary = Color("themePrimary") | |
/// staic color sets (not updating along with color mode) | |
let darkPrimary = Color("darkPrimary") | |
let lightPrimary = Color("lightPrimary") | |
} |
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
struct TokenTypography { | |
// 1. Prepare base materials | |
/// a. Level 1 base settings | |
private enum FontSize: CGFloat { | |
case | |
small = 12, | |
medium = 17, | |
large = 28 |