Skip to content
This repository was archived by the owner on Dec 28, 2022. It is now read-only.

Commit b23e8c6

Browse files
author
Florian Torres
committed
Support brands
2 parents 0cabbef + 38b6d93 commit b23e8c6

File tree

12 files changed

+61
-38
lines changed

12 files changed

+61
-38
lines changed

README.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<img src="./readme-icon.png" alt="Supernova Logo" style="max-width:100%;">
22

3-
4-
[Supernova](https://supernova.io) is a design system platform that allows you to seamlessly translate your design system data to production-ready code. Supernova works with any platform or tech stack, is used by many developers and organizations around the world, and can help you save time by replacing manual and repetitive tasks that all developers hate. To learn everything Supernova, please check out our [developer documentation](https://developers.supernova.io/).
3+
[Supernova](https://supernova.io) is a design system platform that manages your assets, tokens, components and allows you to write spectacular documentations for your entire teams. And because you found your way here, you are probably interested in its most advanced functionality - automatic hand-off of design and development assets, tokens and data in general. To learn everything Supernova, please check out our [developer documentation](https://developers.supernova.io/).
54

65

76
# Tailwind Exporter
@@ -134,48 +133,62 @@ You can generate all production ready-code either manually using Supernova's [VS
134133

135134
In order to make the Supernova Tailwind exporter available for your organization so you can start generating code from your design system, please follow the installation guide in our [developer documentation](https://developers.supernova.io/using-exporters/installing-exporters).
136135

136+
137137
## Reporting Bugs or Requesting Features
138138

139139
In order to faciliate easy communication and speed up delivery of fixes and features for this exporter, we require everyone to log all issues and feature requests through the issue tracking of this repository.
140140

141141
Please read through the [existing issues](../../issues) before you open a new issue! It might be that we have already discussed it before. If you are sure your request wasn't mentioned just yet, proceed to [open a new issue](../../issues) and fill in the required information. Thank you!
142142

143+
143144
## Contributing
144145

145-
If you have an idea for improving this exporter package or want a specific issue fixed quickly, we would love to see you contribute to its development!
146+
If you have an idea for improving this exporter package or want a specific issue fixed quickly, we would love to see you contribute to its development!
147+
148+
There are multiple ways you can contribute, so we have written a [contribution guide](https://developers.supernova.io/building-exporters/contribution-and-requests) that will walk your through the process. Any pull requests to this repository are very welcome.
149+
150+
Would love to help us build more but maybe need a little bit of support? [Join our community](https://community.supernova.io) and drop us a message, we will support any of your wild ideas!
146151

147-
There are multiple ways you can contribute, so we have written a [contribution guide](https://developers.supernova.io/building-exporters/contribution-and-requests) that will walk your through the process. Any pull requests to this repository are very welcome.
148152

149153
## License
150154

151155
This exporter is distributed under the [MIT license](./LICENSE.md). [We absolutely encourage you](https://developers.supernova.io/building-exporters/cloning-exporters) to clone it and modify it for your purposes, so it fits the requirements of your stack. If you see that you have created something amazing in the process that others would benefit from, we strongly recommend you consider [publishing it back to the community](https://developers.supernova.io/building-exporters/sharing-exporters-with-others) as well.
152156

157+
153158
## Useful Links
154159

155160
- To learn more about Supernova, [go visit our website](https://supernova.io)
156161
- To join our community of fellow developers where we try to push what is possible with design systems and code automation, join our [community discord](https://community.supernova.io)
157162
- To understand everything you can do with Supernova and how much time and resources it can save you, go read our [product documentation](https://learn.supernova.io/)
158163
- Finally, to learn everything about what exporters are and how you can integrate with your codebase, go read our [developer documentation](https://developers.supernova.io/)
159164

160-
## Other Supernova Exporters
165+
166+
## Supernova Maintained Exporters
161167

162168
We are developing and maintaining exporters for many major technologies. Here are all the official exporters maintained by Supernova:
163169

164-
- [iOS Exporter](https://github.com/Supernova-Studio/exporter-ios)
170+
- [iOS Token & Style Exporter](https://github.com/Supernova-Studio/exporter-ios)
165171
- [iOS Localization Exporter](https://github.com/Supernova-Studio/exporter-ios-localization)
166-
- [Android Exporter](https://github.com/Supernova-Studio/exporter-android)
167-
- [React Exporter](https://github.com/Supernova-Studio/exporter-react)
168-
- [Flutter Exporter](https://github.com/Supernova-Studio/exporter-flutter)
169-
- [Angular Exporter](https://github.com/Supernova-Studio/exporter-angular)
170-
- [Typescript Exporter](https://github.com/Supernova-Studio/exporter-typescript)
171-
- [CSS Exporter](https://github.com/Supernova-Studio/exporter-css)
172-
- [LESS Exporter](https://github.com/Supernova-Studio/exporter-less)
173-
- [SCSS Exporter](https://github.com/Supernova-Studio/exporter-scss)
172+
- [Android Token & Style Exporter](https://github.com/Supernova-Studio/exporter-android)
173+
- [React Token & Style Exporter](https://github.com/Supernova-Studio/exporter-react)
174+
- [Flutter Token & Style Exporter](https://github.com/Supernova-Studio/exporter-flutter)
175+
- [Angular Token & Style Exporter](https://github.com/Supernova-Studio/exporter-angular)
176+
- [Typescript Token & Style Exporter](https://github.com/Supernova-Studio/exporter-typescript)
177+
- [CSS Token & Style Exporter](https://github.com/Supernova-Studio/exporter-css)
178+
- [LESS Token & Style Exporter](https://github.com/Supernova-Studio/exporter-less)
179+
- [SCSS Token & Style Exporter](https://github.com/Supernova-Studio/exporter-scss)
180+
- [Style Dictionary Exporter](https://github.com/Supernova-Studio/exporter-style-dictionary)
174181

182+
Additionally, you can also use asset exporters for all major targets, enjoy!:
175183

176-
Additionally, we are also developing and maintaining exporters for specific use cases:
184+
- [SVG Asset Exporter](https://github.com/Supernova-Studio/exporter-svg-assets)
185+
- [PDF Asset Exporter](https://github.com/Supernova-Studio/exporter-pdf-assets)
186+
- [PNG Asset Exporter](https://github.com/Supernova-Studio/exporter-png-assets)
187+
- [iOS Asset Catalogue Exporter](https://github.com/Supernova-Studio/exporter-ios-asset-catalogue)
188+
- [React Native Asset Exporter](https://github.com/Supernova-Studio/exporter-react-native-assets)
189+
- [Android Asset Exporter](https://github.com/Supernova-Studio/exporter-android-assets)
190+
- [Flutter PNG Asset Exporter](https://github.com/Supernova-Studio/exporter-flutter-png-assets)
191+
- [Flutter SVG Asset Exporter](https://github.com/Supernova-Studio/exporter-flutter-svg-assets)
177192

178-
- [Style Dictionary Exporter](https://github.com/Supernova-Studio/exporter-style-dictionary)
179-
- [HTML Preview Exporter](https://github.com/Supernova-Studio/exporter-html-preview)
193+
To browse all exporters created by our amazing community, please visit the [Supernova](https://supernova.io) Exporter Store.
180194

181-
To browse all exporters created by our amazing community, please visit the [Supernova](https://supernova.io) Exporter Store.

exporter.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"organization": "Ascanio",
77
"homepage": "https://ascan.io",
88
"source_dir": "src",
9-
"version": "1.2.0",
9+
"version": "1.2",
10+
"usesBrands": true,
1011
"config": {
1112
"sources": "sources.json",
1213
"output": "output.json",
@@ -21,4 +22,4 @@
2122
"Tokens",
2223
"Styles"
2324
]
24-
}
25+
}

src/borders.pr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ and their value rendered using `rendered-border` blueprint
66

77
*}
88
:root {
9-
{[ for token in ds.tokensByType("Border") ]}
9+
{[ let brand = ds.currentBrand() /]}
10+
{[ for token in ds.tokensByType("Border", brand.id) ]}
1011
{[ inject "rendered-token-var" context token /]}
1112

1213

src/colors.pr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ and their value rendered using `rendered-color` blueprint
66

77
*}
88
:root {
9-
{[ for token in ds.tokensByType("Color") ]}
9+
{[ let brand = ds.currentBrand() /]}
10+
{[ for token in ds.tokensByType("Color", brand.id) ]}
1011
{[ inject "rendered-token-var" context token /]}
1112

1213

src/gradients.pr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ and their value rendered using `gradient-color` blueprint
66

77
*}
88
:root {
9-
{[ for token in ds.tokensByType("Gradient") ]}
9+
{[ let brand = ds.currentBrand() /]}
10+
{[ for token in ds.tokensByType("Gradient", brand.id) ]}
1011
{[ inject "rendered-token-var" context token /]}
1112

1213

src/main-renderers/rendered-description.pr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ Rendered as:
2020

2121
/* description */
2222
*}
23-
{[ if (context.description && context.description.count() > 0) ]}/* {{ context.description.replacing("*/", "* /") }} */{[/]}
23+
{[ if (context.description && context.description.count() > 0) ]}/* {{ context.description.replacing("*/", "* /") }} */{[/]}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
module.exports = {
22
'colors': {
3-
{[ const colorGroup = ds.tokenGroupTreeByType("Color") /]}
3+
{[ let brand = ds.currentBrand() /]}
4+
{[ const colorGroup = ds.tokenGroupTreeByType("Color", brand.id) /]}
45
{[ traverse colorGroup property subgroups into subgroup ]}
56
{[ if !subgroup.isRoot ]}
67
'{{ subgroup.name.lowercased() }}': {
78
{[ const tokens = ds.tokensByGroupId(subgroup.id) /]}
89
{[ for token in tokens ]}
910
{[ let tokenName = token.name.replacing("$", "") /]}
10-
'{{ ((tokenName === "main") ? "DEFAULT" : tokenName) }}': 'var(--{[ inject "rendered-name" context token /]})', {[ inject "rendered-description" context token /]}
11+
'{{ ((tokenName === "main") ? "DEFAULT" : tokenName) }}': 'var(--{[ inject "rendered-name" context token /]})', {[ inject "rendered-description" context token /]}
12+
1113
{[/]}
1214
},
1315
{[/]}
1416
{[/]}
1517
},
1618
'boxShadow': {
17-
{[ const shadowTokens = ds.tokensByType("Shadow") /]}
19+
{[ const shadowTokens = ds.tokensByType("Shadow", brand.id) /]}
1820
{[ for token in shadowTokens ]}
19-
{[ let tokenName = token.name.replacing("$", "") /]}
20-
'{{ ((tokenName === "box-shadow") ? "DEFAULT" : tokenName) }}': 'var(--{[ inject "rendered-name" context token /]})', {[ inject "rendered-description" context token /]}
21+
{[ let tokenName = token.name.replacing("$", "").replacing(" ", "-") /]}
22+
'{{ ((tokenName === "box-shadow") ? "DEFAULT" : tokenName) }}': 'var(--{[ inject "rendered-name" context token /]})', {[ inject "rendered-description" context token /]}
23+
2124
{[/]}
2225
}
2326
}

src/measures.pr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ and their value rendered using `rendered-measure` blueprint
66

77
*}
88
:root {
9-
{[ for token in ds.tokensByType("Measure") ]}
9+
{[ let brand = ds.currentBrand() /]}
10+
{[ for token in ds.tokensByType("Measure", brand.id) ]}
1011
{[ inject "rendered-token-var" context token /]}
1112

1213

src/shadows.pr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ and their value rendered using `shadow-color` blueprint
66

77
*}
88
:root {
9-
{[ for token in ds.tokensByType("Shadow") ]}
9+
{[ let brand = ds.currentBrand() /]}
10+
{[ for token in ds.tokensByType("Shadow", brand.id) ]}
1011
{[ inject "rendered-token-var" context token /]}
1112

1213

src/token-renderers/rendered-gradient.pr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ linear-gradient(
4040
{[ let gradientType = "linear-gradient" /]}
4141
{[ let gradientDirection = gradientAngle(context.from, context.to).rounded(2).toString().suffixed("deg") /]}
4242
{[ if (context.type === "Radial") ]}
43-
{[ set "gradientType" = "radial-gradient" /]}
44-
{[ set "gradientDirection" = "circle at center" /]}
43+
{[ "gradientType" = "radial-gradient" /]}
44+
{[ "gradientDirection" = "circle at center" /]}
4545
{[/]}
4646
{{ gradientType }}(
4747
{{ gradientDirection }},

src/token-renderers/rendered-measure.pr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Note: Value is passed as `context` property because it is injected
2020
{[ let unit = "px" /]}
2121
{[ switch context.unit ]}
2222
{[ case "Points"]}
23-
{[ set unit = "pt"/]}
23+
{[ unit = "pt"/]}
2424
{[ case "Percent"]}
25-
{[ set unit = "%"/]}
25+
{[ unit = "%"/]}
2626
{[ case "Ems"]}
27-
{[ set unit = "em"/]}
27+
{[ unit = "em"/]}
2828
{[/]}
2929
{{ context.measure }}{{ unit }}
3030
{[/]}

src/typography.pr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ Tokens are named by their group path and then name,
55
and their value rendered using `rendered-color` blueprint
66

77
*}
8-
{[ const allTokens = ds.tokensByType("Typography") /]}
8+
{[ let brand = ds.currentBrand() /]}
9+
{[ const allTokens = ds.tokensByType("Typography", brand.id) /]}
910
{[ for token in allTokens ]}
1011
{[ if !token.referencedToken ]}
11-
{[ inject "rendered-token-class" context { "token": token, "allTokens": allTokens } /]}
12+
{[ inject "rendered-token-class" context { "token": token, "allTokens": allTokens } /]}
1213

1314

1415
{[/]}

0 commit comments

Comments
 (0)