diff --git a/exporter.json b/exporter.json index 062a224..958e721 100644 --- a/exporter.json +++ b/exporter.json @@ -3,7 +3,7 @@ "name": "iOS SwiftUI", "description": "iOS SwiftUI token and style exporter", "source_dir": "src", - "version": "2.0.0", + "version": "2.1.0", "usesBrands": true, "tags": [ "iOS", diff --git a/output.json b/output.json index c834f72..45ee7c9 100644 --- a/output.json +++ b/output.json @@ -8,6 +8,10 @@ "invoke": "colors.pr", "write_to": "Styles/Colors.swift" }, + { + "invoke": "colorsThemeable.pr", + "write_to": "Styles/ColorsThemeable.swift" + }, { "invoke": "gradients.pr", "write_to": "Styles/Gradients.swift" diff --git a/src/exported_files/colorsThemeable.pr b/src/exported_files/colorsThemeable.pr new file mode 100644 index 0000000..cf52e51 --- /dev/null +++ b/src/exported_files/colorsThemeable.pr @@ -0,0 +1,28 @@ +import SwiftUI + +// Generated by Supernova - do not modify manually + +public protocol ColorTokenThemeable { + {[ let brand = ds.currentBrand() /]} + {[ for group in ds.tokenGroupsOfType("Color", brand.id) ]} + {[ if !(group.tokenIds.count() === 0 && group.subgroups.count() === 0) ]} + {[ if !group.isRoot ]} + + // {{ group.name }} + + {[/]} + {[ const tokens = ds.tokensByGroupId(group.id) /]} + {[ if (group.tokenIds.count() !== 0 && (tokens.first() && tokens.first().description === 0)) ]} + + {[/]} + {[ for token in tokens ]} + {[ if (token.description && token.description.count() !== 0) ]} + + {{ createDocumentationComment(token.description, " ") }} + + {[/]} + static var {[ inject "token_name" context this /]}: Color { get } + {[/]} + {[/]} + {[/]} +} \ No newline at end of file