Skip to content

Commit

Permalink
token rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-figma committed Jun 14, 2024
1 parent c9b15e2 commit 0d18c69
Show file tree
Hide file tree
Showing 36 changed files with 3,148 additions and 3,394 deletions.
3 changes: 0 additions & 3 deletions scripts/icons/app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import fs from "fs";

// run with node --env-file=.env app.mjs
const TOKEN = process.env.FIGMA_ACCESS_TOKEN;
const _URL_BASE = "https://api.staging.figma.com/v1/files";
const _FILE_URL_BASE = "https://staging.figma.com/design/";
const _FILE_KEY = "YfiqA0yWMXuLJAzkZNpBdy";
const URL_BASE = "https://api.figma.com/v1/files";
const URL_BASE_IMAGES = "https://api.figma.com/v1/images";
const FILE_URL_BASE = "https://figma.com/design/";
Expand Down
21 changes: 16 additions & 5 deletions scripts/tokens/app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ function processTokenJSON(data) {
colorSchemes: COLOR_THEMES,
colorSchemesDark: COLOR_THEMES_DARK,
},
responsive: {
main: {},
responsiveSizeOrder: ["mobile", "tablet", "desktop"],
responsiveSizeTokenSuffix: "Root Font Size",
},
size: { main: {} },
typography_primitives: { main: {} },
typography: { main: {} },
Expand All @@ -69,10 +74,16 @@ function processTokenJSON(data) {
processCollection(data, processed.color_primitives, "@color_primitives", {
prefix: "color",
});
processCollection(data, processed.color, "@colors", {
processCollection(data, processed.color, "@color", {
prefix: "color",
replacements: {
"@color_primitives": `${TOKEN_PREFIX}color`,
color_primitives: "color",
},
});
processCollection(data, processed.responsive, "@responsive", {
prefix: "responsive",
replacements: {
"@typography_primitives": "typography",
},
});
processCollection(
Expand All @@ -82,7 +93,7 @@ function processTokenJSON(data) {
{
prefix: "typography",
replacements: {
"@responsive": `${TOKEN_PREFIX}responsive`,
"@responsive": "responsive",
"Extra Bold Italic": "800 italic",
"Semi Bold Italic": "600 italic",
"Medium Italic": "500 italic",
Expand All @@ -106,7 +117,7 @@ function processTokenJSON(data) {
processCollection(data, processed.size, "@size", {
prefix: "size",
replacements: {
"@responsive": `${TOKEN_PREFIX}responsive`,
"@responsive": "responsive",
},
convertPixelToRem: true,
});
Expand Down Expand Up @@ -336,7 +347,7 @@ In the future, themeing will be handled via @container style() queries
for (let replacement in replacements) {
value = value.replace(replacement, replacements[replacement]);
}
return value;
return value.toLowerCase();
};
const propertyName =
propertyNameFull.charAt(0).toLowerCase() + propertyNameFull.slice(1);
Expand Down
104 changes: 52 additions & 52 deletions scripts/tokens/styles.json
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
[
{
"type": "TEXT",
"name": "Body Strong",
"name": "Title Hero",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10180"
"id": "VariableID:66:10189"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10179"
"id": "VariableID:66:10188"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:14844"
"id": "VariableID:66:10190"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": "Body Base",
"name": "Title Page",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10180"
"id": "VariableID:66:10197"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10179"
"id": "VariableID:58:8569"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10181"
"id": "VariableID:58:8572"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": "Input",
"name": "Subtitle",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:13415"
"id": "VariableID:66:10177"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:13413"
"id": "VariableID:66:10176"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:13417"
"id": "VariableID:66:10178"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": ".Utilities/Component notes/Regular",
"name": "Heading",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:9:11196"
"id": "VariableID:66:10186"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:9:11201"
"id": "VariableID:66:10185"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:9:11183"
"id": "VariableID:66:10187"
},
"fontStyle": "normal"
},
Expand All @@ -86,136 +86,136 @@
},
{
"type": "TEXT",
"name": "Title Hero",
"name": "Body Base",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10189"
"id": "VariableID:66:10180"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10188"
"id": "VariableID:66:10179"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10190"
"id": "VariableID:66:10181"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": "Title Page",
"name": "Body Strong",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10197"
"id": "VariableID:66:10180"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:58:8569"
"id": "VariableID:66:10179"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:58:8572"
"id": "VariableID:66:14844"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": "Subtitle",
"name": "Body Emphasis",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10177"
"id": "VariableID:66:10180"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10176"
"id": "VariableID:66:10179"
},
"fontWeight": {
"fontStyle": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10178"
},
"fontStyle": "normal"
"id": "VariableID:66:14846"
}
},
{
"type": "TEXT",
"name": "Heading",
"name": "Body Link",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10186"
"id": "VariableID:66:10180"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10185"
"id": "VariableID:66:10179"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10187"
"id": "VariableID:66:10181"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": "Body Emphasis",
"name": "Body Small",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10180"
"id": "VariableID:66:10216"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10179"
},
"fontStyle": {
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:14846"
}
"id": "VariableID:66:10181"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": "Body Link",
"name": "Input",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10180"
"id": "VariableID:66:13415"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10179"
"id": "VariableID:66:13413"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10181"
"id": "VariableID:66:13417"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": "Body Small",
"name": "Body Code",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10216"
"id": "VariableID:66:10183"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10179"
"id": "VariableID:66:10182"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10181"
"id": "VariableID:66:10184"
},
"fontStyle": "normal"
},
{
"type": "TEXT",
"name": "Body Code",
"name": ".Utilities/Component notes/Regular",
"fontSize": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10183"
"id": "VariableID:9:11196"
},
"fontFamily": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10182"
"id": "VariableID:9:11201"
},
"fontWeight": {
"type": "VARIABLE_ALIAS",
"id": "VariableID:66:10184"
"id": "VariableID:9:11183"
},
"fontStyle": "normal"
},
Expand Down
Loading

0 comments on commit 0d18c69

Please sign in to comment.