There are BREAKING CHANGES in this PR, they are all resolved by doing a find and replace but breaking nonetheless, which is why I've pushed the version to be 2.0.0. I believe they offer greater flexibility and would allow for the generation to work in a wider set of circumstances. Please read the README.md first for the new usage of the tokens.
Context:
These changes allow the use of multiple design systems or brands alongside each other in the same application by removing namespace clashes due to the use of extensions.
Use case:
Having dark mode tokens as a separate brand in supernova.
Proposed changes:
color, gradient and measure tokens do not use extensions anymore and are exposed via the struct directly, mirroring the existing measures implementation
BeforeColor.Token.tokenNameAfterColorToken.tokenName
borders, shadows, radii and text styles do not use extensions anymore and are exposed via view modifiers
BeforeText("Styled text").textStyleUi11Regular()AfterText("Styled text").modifier(TextStyleUi11Regular())
took the opportunity to do a refresh on the docs & the file names : )
Note for reviewers:
The diffs look larger than they are due to the indentation changes, apart from the above changes the rest of the logic is untouched.
Update (12.09)
Introduce a colorThemeable.swift file to allow for a theme swicher to be used like such:
var colorToken: ColorTokenThemeable.Type {
switch currentTheme {
case .light:
return DesignSystem.ColorToken.self
case .dark:
return DesignSystemDark.ColorToken.self
}
}
👋
There are BREAKING CHANGES in this PR, they are all resolved by doing a find and replace but breaking nonetheless, which is why I've pushed the version to be
2.0.0
. I believe they offer greater flexibility and would allow for the generation to work in a wider set of circumstances. Please read theREADME.md
first for the new usage of the tokens.Context:
These changes allow the use of multiple design systems or brands alongside each other in the same application by removing namespace clashes due to the use of extensions.
Use case:
Having dark mode tokens as a separate brand in supernova.
Proposed changes:
color, gradient and measure tokens do not use extensions anymore and are exposed via the struct directly, mirroring the existing measures implementation Before
Color.Token.tokenName
AfterColorToken.tokenName
borders, shadows, radii and text styles do not use extensions anymore and are exposed via view modifiers Before
Text("Styled text").textStyleUi11Regular()
AfterText("Styled text").modifier(TextStyleUi11Regular())
took the opportunity to do a refresh on the docs & the file names : )
Note for reviewers:
The diffs look larger than they are due to the indentation changes, apart from the above changes the rest of the logic is untouched.
Update (12.09)
Introduce a
colorThemeable.swift
file to allow for a theme swicher to be used like such: