Basic
Token Aliases could bring more meaning semantic acting as semantic tokens:
{
"styles": {
"colors": ["blueMirage", "beige"],
"aliases": {
"onSurface": "blueMirage",
"surface": "beige"
}
}
}
Generated aliases would be a computed properties on new ShapeStyle+ThemeAliases extension and the that delegate to the underlying tokens:
extension ShapeStyle {
public static var surface: ThemeShapeStyle<Color> { beige }
public static var onSurface: ThemeShapeStyle<Color> { blueMirage }
}
Composition
It could be valuable to have style composition, like this:
{
"styles": {
"colors": ["surface"],
"shadows": ["soft", "strong"],
"aliases": {
"card": [
"surface", "soft"
]
}
}
}
Generated ShapeStyle extension would look like:
extension ShapeStyle {
public static var surface: some ShapeStyle { .surface.soft }
}
Basic
Token Aliases could bring more meaning semantic acting as semantic tokens:
{ "styles": { "colors": ["blueMirage", "beige"], "aliases": { "onSurface": "blueMirage", "surface": "beige" } } }Generated aliases would be a computed properties on new
ShapeStyle+ThemeAliasesextension and the that delegate to the underlying tokens:Composition
It could be valuable to have style composition, like this:
{ "styles": { "colors": ["surface"], "shadows": ["soft", "strong"], "aliases": { "card": [ "surface", "soft" ] } } }Generated
ShapeStyleextension would look like: