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

Commit f977b99

Browse files
authored
Merge pull request #1 from Supernova-Studio/features/pulsar-1.5
Pulsar 1.5 support
2 parents e542bd8 + 45387d9 commit f977b99

15 files changed

+31
-31
lines changed

exporter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"organization": "Supernova",
77
"homepage": "https://supernova.io",
88
"source_dir": "src",
9-
"version": "1.0.3",
9+
"version": "1.1",
1010
"config": {
1111
"sources": "sources.json",
1212
"output": "output.json",

src/borders.pr

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

77
*}
88
:root {
9-
{[ for token in @ds.tokensByType("Border") ]}
9+
{[ for token in ds.tokensByType("Border") ]}
1010
{[ inject "rendered-token-var" context token /]}
1111

1212

src/colors.pr

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

77
*}
88
:root {
9-
{[ for token in @ds.tokensByType("Color") ]}
9+
{[ for token in ds.tokensByType("Color") ]}
1010
{[ inject "rendered-token-var" context token /]}
1111

1212

src/gradients.pr

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

77
*}
88
:root {
9-
{[ for token in @ds.tokensByType("Gradient") ]}
9+
{[ for token in ds.tokensByType("Gradient") ]}
1010
{[ inject "rendered-token-var" context token /]}
1111

1212

src/main-renderers/reference-wrapper.pr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Note: Token is passed as `context` property because it is injected
1818

1919
/* description */
2020
*}
21-
{[ if @compare.null(context.referencedToken) ]}
22-
{{#body}}
23-
{[else]}
21+
{[ if !context.referencedToken ]}
22+
{{ #body }}
23+
{[ else ]}
2424
var(--{[ inject "rendered-name" context context.referencedToken /]}){[/]}

src/main-renderers/rendered-description.pr

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

2121
/* description */
2222
*}
23-
{[ if @boolean.not(@compare.empty(context.description)) ]}
23+
{[ if (context.description && context.description.count() > 0) ]}
2424
/* {{ context.description.replacing("*/", "* /") }} */
2525
{[/]}

src/main-renderers/rendered-name.pr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Rendered as:
2424
[group1][group2][...][name];
2525

2626
*}
27-
{[ let tokenGroup = @ds.tokenGroupContainingTokenId(context.id) /]}
27+
{[ let tokenGroup = ds.tokenGroupContainingTokenId(context.id) /]}
2828
{[ let prefix = "" /]}
2929
{[ switch context.tokenType ]}
3030
{[ case "Color" ]}{[ prefix = behavior.colorTokenPrefix /]}
@@ -35,5 +35,5 @@ Rendered as:
3535
{[ case "Gradient" ]}{[ prefix = behavior.gradientTokenPrefix /]}
3636
{[ default ]}{[ prefix = "" /]}
3737
{[/]}
38-
{[ let tokenName = @js.readableVariableName(context, tokenGroup, prefix) /]}
38+
{[ let tokenName = readableVariableName(context, tokenGroup, prefix) /]}
3939
{{ tokenName }}

src/main-renderers/rendered-token-class.pr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Rendered as:
2929
{[ inject "rendered-description" context token /]}
3030
.{[ inject "rendered-name" context token /]}
3131

32-
{[ for alias in @js.findAliases(context.token, context.allTokens) ]}
32+
{[ for alias in (findAliases(context.token, context.allTokens)) ]}
3333
, {[ inject "rendered-description" context alias /]}
3434
.{[ inject "rendered-name" context alias /]}
3535
{[/]} {

src/measures.pr

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

77
*}
88
:root {
9-
{[ for token in @ds.tokensByType("Measure") ]}
9+
{[ for token in ds.tokensByType("Measure") ]}
1010
{[ inject "rendered-token-var" context token /]}
1111

1212

src/shadows.pr

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

77
*}
88
:root {
9-
{[ for token in @ds.tokensByType("Shadow") ]}
9+
{[ for token in ds.tokensByType("Shadow") ]}
1010
{[ inject "rendered-token-var" context token /]}
1111

1212

src/token-renderers/rendered-color.pr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Rendered as:
2727

2828
*}
2929
{[ inject "reference-wrapper" context context ]}
30-
{[ if @compare.lessThan(context.a, 255) ]}
30+
{[ if (context.a < 255) ]}
3131
#{{ context.hex }}
3232
{[ else ]}
3333
#{{ context.hex.substring(0, 6) }}

src/token-renderers/rendered-gradient.pr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ linear-gradient(
3838
*}
3939
{[ inject "reference-wrapper" context context ]}
4040
{[ let gradientType = "linear-gradient" /]}
41-
{[ let gradientDirection = @js.gradientAngle(context.from, context.to).rounded(2).toString().suffixed("deg") /]}
42-
{[ if @compare.equals(context.type, "Radial") ]}
43-
{[ set "gradientType" = "radial-gradient" /]}
44-
{[ set "gradientDirection" = "circle at center" /]}
41+
{[ let gradientDirection = gradientAngle(context.from, context.to).rounded(2).toString().suffixed("deg") /]}
42+
{[ if (context.type === "Radial") ]}
43+
{[ "gradientType" = "radial-gradient" /]}
44+
{[ "gradientDirection" = "circle at center" /]}
4545
{[/]}
4646
{{ gradientType }}(
4747
{{ gradientDirection }},
4848
{[ for stop in context.stops ]}
49-
{[ inject "rendered-color" context stop.color /]} {{ stop.position.multipliedBy(100).rounded(1) }}%{[ if @boolean.not(#last) ]}, {[/]}
49+
{[ inject "rendered-color" context stop.color /]} {{ (stop.position * 100).rounded(1) }}%{[ if !(#last) ]}, {[/]}
5050

5151
{[/]}
5252
)

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/token-renderers/rendered-typography.pr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ Rendered as:
5353
*}
5454

5555
{[ let fontStyle = "normal" /]}
56-
{[ if @ds.fonts.isItalic(context.font) ]}
57-
{[ set fontStyle = "italic" /]}
56+
{[ if ds.isFontItalic(context.font) ]}
57+
{[ fontStyle = "italic" /]}
5858
{[/]}
5959
font-family: "{{ context.font.family }}";
6060
font-style: {{ fontStyle }};
61-
font-weight: {{ @ds.fonts.weight(context.font) }};
61+
font-weight: {{ ds.fontWeight(context.font) }};
6262
font-size: {[ inject "rendered-measure" context context.fontSize /]};
63-
{[ if @compare.nonnull(context.lineHeight) ]}
63+
{[ if context.lineHeight ]}
6464
line-height: {[ inject "rendered-measure" context context.lineHeight /]};
6565
{[/]}
66-
letter-spacing: {[if @compare.equals(context.letterSpacing.unit, "Percent") ]}
67-
{{ context.letterSpacing.measure.dividedBy(100).rounded(2) }}em;
66+
letter-spacing: {[if (context.letterSpacing.unit === "Percent") ]}
67+
{{ (context.letterSpacing.measure / 100).rounded(2) }}em;
6868
{[ else ]}
6969
{[ inject "rendered-measure" context context.letterSpacing /]};
7070
{[/]}

src/typography.pr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ 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+
{[ const allTokens = ds.tokensByType("Typography") /]}
99
{[ for token in allTokens ]}
10-
{[ if @compare.null(token.referencedToken) ]}
11-
{[ inject "rendered-token-class" context @init.dictionary().add("token", token).add("allTokens", allTokens) /]}
10+
{[ if !token.referencedToken ]}
11+
{[ inject "rendered-token-class" context { "token": token, "allTokens": allTokens } /]}
1212

1313

1414
{[/]}

0 commit comments

Comments
 (0)