Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: get rid of mentions of .value for references #1443

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ This tells the style dictionary build system how and what to build. The default
"small": { "value": "10px" },
"medium": { "value": "16px" },
"large": { "value": "24px" },
"base": { "value": "{size.font.medium.value}" }
"base": { "value": "{size.font.medium}" }
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion __integration__/css.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('integration', async () => {
breakpoint: {
xs: { value: '304px' },
sm: { value: '768px' },
md: { value: 'calc({breakpoint.xs.value} / {breakpoint.sm.value})' },
md: { value: 'calc({breakpoint.xs} / {breakpoint.sm})' },
},
},
platforms: {
Expand Down
12 changes: 6 additions & 6 deletions __integration__/logging/platform.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe(`integration`, () => {
const sd = new StyleDictionary({
tokens: {
color: {
danger: { value: '{color.red.value}' },
danger: { value: '{color.red}' },
},
},
platforms: {
Expand All @@ -112,11 +112,11 @@ describe(`integration`, () => {
const sd = new StyleDictionary({
tokens: {
color: {
foo: { value: '{color.foo.value}' },
teal: { value: '{color.blue.value}' },
blue: { value: '{color.green.value}' },
green: { value: '{color.teal.value}' },
purple: { value: '{color.teal.value}' },
foo: { value: '{color.foo}' },
teal: { value: '{color.blue}' },
blue: { value: '{color.green}' },
green: { value: '{color.teal}' },
purple: { value: '{color.teal}' },
},
},
platforms: {
Expand Down
2 changes: 1 addition & 1 deletion __integration__/nameCollisions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const tokens = {
color: {
red: { value: '#f00' },
background: {
red: { value: '{color.red.value}' },
red: { value: '{color.red}' },
},
},
};
Expand Down
12 changes: 6 additions & 6 deletions __integration__/objectValues.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ describe('integration', async () => {
primary: {
// getReferences should work on objects like this:
value: {
color: '{color.red.value}',
width: '{size.border.value}',
color: '{color.red}',
width: '{size.border}',
style: 'solid',
},
type: 'border',
Expand All @@ -61,21 +61,21 @@ describe('integration', async () => {
light: {
value: [
{
color: '{color.red.value}',
color: '{color.red}',
},
{
color: '{color.green.value}',
color: '{color.green}',
},
],
type: 'shadow',
},
dark: {
value: [
{
color: '{color.green.value}',
color: '{color.green}',
},
{
color: '{color.red.value}',
color: '{color.red}',
},
],
type: 'shadow',
Expand Down
16 changes: 8 additions & 8 deletions __integration__/tokens/color/background.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"color": {
"background": {
"primary": { "value": "{color.core.neutral.0.value}", "type": "color", "themeable": true },
"secondary": { "value": "{color.core.neutral.100.value}", "type": "color" },
"tertiary": { "value": "{color.core.neutral.200.value}", "type": "color" },
"danger": { "value": "{color.core.red.0.value}", "type": "color" },
"warning": { "value": "{color.core.orange.0.value}", "type": "color" },
"success": { "value": "{color.core.green.0.value}", "type": "color" },
"info": { "value": "{color.core.blue.0.value}", "type": "color" },
"disabled": { "value": "{color.background.tertiary.value}", "type": "color" }
"primary": { "value": "{color.core.neutral.0}", "type": "color", "themeable": true },
"secondary": { "value": "{color.core.neutral.100}", "type": "color" },
"tertiary": { "value": "{color.core.neutral.200}", "type": "color" },
"danger": { "value": "{color.core.red.0}", "type": "color" },
"warning": { "value": "{color.core.orange.0}", "type": "color" },
"success": { "value": "{color.core.green.0}", "type": "color" },
"info": { "value": "{color.core.blue.0}", "type": "color" },
"disabled": { "value": "{color.background.tertiary}", "type": "color" }
}
}
}
2 changes: 1 addition & 1 deletion __integration__/tokens/color/border.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"color": {
"border": {
"primary": { "value": "{color.core.neutral.300.value}", "type": "color" },
"primary": { "value": "{color.core.neutral.300}", "type": "color" },
"secondary": {},
"tertiary": {}
}
Expand Down
4 changes: 2 additions & 2 deletions __integration__/tokens/color/brand.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"color": {
"brand": {
"primary": {
"value": "{color.core.aqua.700.value}",
"value": "{color.core.aqua.700}",
"type": "color"
},

"secondary": {
"value": "{color.core.purple.700.value}",
"value": "{color.core.purple.700}",
"type": "color"
}
}
Expand Down
24 changes: 12 additions & 12 deletions __integration__/tokens/color/font.jsonc
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"color": {
"font": {
"primary": { "value": "{color.core.neutral.1100.value}", "type": "color" },
"secondary": { "value": "{color.core.neutral.900.value}", "type": "color" },
"tertiary": { "value": "{color.core.neutral.800.value}", "type": "color" },
"primary": { "value": "{color.core.neutral.1100}", "type": "color" },
"secondary": { "value": "{color.core.neutral.900}", "type": "color" },
"tertiary": { "value": "{color.core.neutral.800}", "type": "color" },

"interactive": {
"_": { "value": "{color.brand.primary.value}", "type": "color" },
"hover": { "value": "{color.brand.primary.value}", "type": "color" },
"active": { "value": "{color.brand.secondary.value}", "type": "color" },
"disabled": { "value": "{color.font.tertiary.value}", "type": "color" }
"_": { "value": "{color.brand.primary}", "type": "color" },
"hover": { "value": "{color.brand.primary}", "type": "color" },
"active": { "value": "{color.brand.secondary}", "type": "color" },
"disabled": { "value": "{color.font.tertiary}", "type": "color" },
},

"danger": { "value": "{color.core.red.1000.value}", "type": "color" },
"warning": { "value": "{color.core.orange.1000.value}", "type": "color" },
"danger": { "value": "{color.core.red.1000}", "type": "color" },
"warning": { "value": "{color.core.orange.1000}", "type": "color" },
// make sure references without .value work too
"success": { "value": "{color.core.green.1000}", "type": "color" }
}
}
"success": { "value": "{color.core.green.1000}", "type": "color" },
},
},
}
2 changes: 1 addition & 1 deletion __tests__/__configs/tokenCollisions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"color": {
"red": { "value": "#f00" },
"background": {
"red": { "value": "{color.red.value}" }
"red": { "value": "{color.red}" }
}
}
},
Expand Down
30 changes: 15 additions & 15 deletions __tests__/__json_files/not_circular.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"prop0" : { "value": 0 },
"prop01" : { "value": "" },
"prop1" : { "value": "test1 value" },
"prop2" : { "value": "test2 value" },
"prop3" : { "value": "{prop1.value}" },
"prop4" : { "value": "{prop3.value}" },
"prop5" : { "value": 5 },
"prop6" : { "value": 6 },
"prop7" : { "value": "{prop5.value}" },
"prop8" : { "value": "{prop7.value}" },
"prop12" : { "value": "{prop1.value}, {prop2.value} and some extra stuff" },
"prop124" : { "value": "{prop1.value}, {prop2.value} and {prop4.value}" },
"prop15" : { "value": "{prop1.value}, {prop5.value} and some extra stuff" },
"prop156" : { "value": "{prop1.value}, {prop5.value} and {prop6.value}" },
"prop1568" : { "value": "{prop1.value}, {prop5.value}, {prop6.value} and {prop8.value}" }
"prop0": { "value": 0 },
"prop01": { "value": "" },
"prop1": { "value": "test1 value" },
"prop2": { "value": "test2 value" },
"prop3": { "value": "{prop1}" },
"prop4": { "value": "{prop3}" },
"prop5": { "value": 5 },
"prop6": { "value": 6 },
"prop7": { "value": "{prop5}" },
"prop8": { "value": "{prop7}" },
"prop12": { "value": "{prop1}, {prop2} and some extra stuff" },
"prop124": { "value": "{prop1}, {prop2} and {prop4}" },
"prop15": { "value": "{prop1}, {prop5} and some extra stuff" },
"prop156": { "value": "{prop1}, {prop5} and {prop6}" },
"prop1568": { "value": "{prop1}, {prop5}, {prop6} and {prop8}" }
}
14 changes: 7 additions & 7 deletions __tests__/__tokens/borders.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@
"border": {
"layout": {
"light": {
"value": "1px solid {color.border.light.value}",
"value": "1px solid {color.border.light}",
"type": "border",
"comment": ""
},
"dark": {
"value": "1px solid {color.border.dark.value}",
"value": "1px solid {color.border.dark}",
"type": "border",
"comment": ""
},
"base": {
"value": "1px solid {color.border.base.value}",
"value": "1px solid {color.border.base}",
"type": "border",
"comment": ""
}
},

"input": {
"base": {
"value": "1px solid {color.border.base.value}",
"value": "1px solid {color.border.base}",
"type": "border",
"comment": ""
},
"focus": {
"value": "1px solid {color.border.focus.value}",
"value": "1px solid {color.border.focus}",
"type": "border",
"comment": ""
},
"error": {
"value": "1px solid {color.border.base.value}",
"value": "1px solid {color.border.base}",
"type": "border",
"comment": ""
},
"button": {
"value": "1px solid {color.font.link.value}",
"value": "1px solid {color.font.link}",
"type": "border",
"comment": ""
}
Expand Down
16 changes: 8 additions & 8 deletions __tests__/__tokens/colors.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,27 @@
},

"border": {
"light": { "value": "{color.base.squidink.10.value}", "type": "color" },
"base": { "value": "{color.base.squidink.20.value}", "type": "color" },
"dark": { "value": "{color.base.squidink.40.value}", "type": "color" },
"focus": { "value": "{color.base.orange.100.value}", "type": "color" }
"light": { "value": "{color.base.squidink.10}", "type": "color" },
"base": { "value": "{color.base.squidink.20}", "type": "color" },
"dark": { "value": "{color.base.squidink.40}", "type": "color" },
"focus": { "value": "{color.base.orange.100}", "type": "color" }
},

"font": {
"link": { "value": "{color.base.blue.100.value}", "type": "color" }
"link": { "value": "{color.base.blue.100}", "type": "color" }
},

"button": {
"base": { "value": "{color.base.blue.100.value}", "type": "color" },
"base": { "value": "{color.base.blue.100}", "type": "color" },
"active": {
"value": "{color.button.base.value}",
"value": "{color.button.base}",
"type": "color",
"transformColor": {
"darken": 0.5
}
},
"hover": {
"value": "{color.button.active.value}",
"value": "{color.button.active}",
"type": "color",
"transformColor": {
"darken": 0.2
Expand Down
2 changes: 1 addition & 1 deletion __tests__/__tokens/font_sizes.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"type": "fontSize"
},
"base": {
"value": "{size.font.medium.value}",
"value": "{size.font.medium}",
"type": "fontSize"
}
}
Expand Down
10 changes: 5 additions & 5 deletions __tests__/__tokens/nonString.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "color"
},
"otherRed": {
"value": "{color.red.value}",
"value": "{color.red}",
"type": "color"
}
},
Expand All @@ -21,19 +21,19 @@
"type": "dimension"
},
"otherLarge": {
"value": "{size.large.value}",
"value": "{size.large}",
"type": "dimension"
}
},

"number": {
"test": { "value": 20, "type": "number" },
"otherTest": { "value": "{number.test.value}", "type": "number" }
"otherTest": { "value": "{number.test}", "type": "number" }
},

"array": {
"test": { "value": ["foo", "bar"] },
"otherTest": { "value": "{array.test.value}" }
"otherTest": { "value": "{array.test}" }
},

"object": {
Expand All @@ -45,6 +45,6 @@
}
}
},
"otherTest": { "value": "{object.test.value}" }
"otherTest": { "value": "{object.test}" }
}
}
Loading