{"id":26341052,"url":"https://github.com/frontify/fondue-tokens","last_synced_at":"2025-03-16T04:28:37.048Z","repository":{"id":39886535,"uuid":"422156321","full_name":"Frontify/fondue-tokens","owner":"Frontify","description":"The single source of truth for design tokens within the fondue design system. Token values are available in various formats to ensure they are compatible with all Frontify branded applications.","archived":false,"fork":false,"pushed_at":"2023-12-13T10:39:55.000Z","size":678,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":18,"default_branch":"next","last_synced_at":"2024-04-14T06:46:49.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Frontify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-10-28T10:14:05.000Z","updated_at":"2024-04-17T09:44:02.894Z","dependencies_parsed_at":"2022-09-10T14:40:23.074Z","dependency_job_id":"d1041954-9c0c-4818-a875-0738e691b153","html_url":"https://github.com/Frontify/fondue-tokens","commit_stats":{"total_commits":124,"total_committers":9,"mean_commits":"13.777777777777779","dds":"0.45967741935483875","last_synced_commit":"4d1ef53ececed7edcb726785f67996f5c5ba8588"},"previous_names":["frontify/arcade-tokens"],"tags_count":66,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frontify%2Ffondue-tokens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frontify%2Ffondue-tokens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frontify%2Ffondue-tokens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frontify%2Ffondue-tokens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Frontify","download_url":"https://codeload.github.com/Frontify/fondue-tokens/tar.gz/refs/heads/next","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826825,"owners_count":20354220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-16T04:28:36.534Z","updated_at":"2025-03-16T04:28:37.035Z","avatar_url":"https://github.com/Frontify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### [ Deprecation warning ]\n\u003e This repository is no longer in use. The `fonude-tokens` package is maintained inside the [Fondue monorepo](https://github.com/Frontify/fondue/tree/main/packages/tokens)\n\n# Fondue Tokens\n\nThis example code is bare-bones to show you what this framework can do. If you have the style-dictionary module installed globally, you can `cd` into this directory and run:\n\n```bash\nstyle-dictionary build\n```\n\nYou should see something like this output:\n\n```\nCopying starter files...\n\nSource style dictionary starter files created!\n\nRunning `style-dictionary build` for the first time to generate build artifacts.\n\n\nscss\n✔︎  build/scss/_variables.scss\n\nandroid\n✔︎  build/android/font_dimens.xml\n✔︎  build/android/colors.xml\n\ncompose\n✔︎ build/compose/StyleDictionaryColor.kt\n✔︎ build/compose/StyleDictionarySize.kt\n\nios\n✔︎  build/ios/StyleDictionaryColor.h\n✔︎  build/ios/StyleDictionaryColor.m\n✔︎  build/ios/StyleDictionarySize.h\n✔︎  build/ios/StyleDictionarySize.m\n\nios-swift\n✔︎  build/ios-swift/StyleDictionary.swift\n\nios-swift-separate-enums\n✔︎  build/ios-swift/StyleDictionaryColor.swift\n✔︎  build/ios-swift/StyleDictionarySize.swift\n```\n\nGood for you! You have now built your first style dictionary! Moving on, take a look at what we have built. This should have created a build directory and it should look like this:\n\n```\n├── README.md\n├── config.json\n├── tokens/\n│   ├── color/\n│       ├── base.json\n│       ├── font.json\n│   ├── size/\n│       ├── font.json\n├── build/\n│   ├── android/\n│      ├── font_dimens.xml\n│      ├── colors.xml\n│   ├── compose/\n│      ├── StyleDictionaryColor.kt\n│      ├── StyleDictionarySize.kt\n│   ├── scss/\n│      ├── _variables.scss\n│   ├── ios/\n│      ├── StyleDictionaryColor.h\n│      ├── StyleDictionaryColor.m\n│      ├── StyleDictionarySize.h\n│      ├── StyleDictionarySize.m\n│   ├── ios-swift/\n│      ├── StyleDictionary.swift\n│      ├── StyleDictionaryColor.swift\n│      ├── StyleDictionarySize.swift\n```\n\nIf you open `config.json` you will see there are 5 platforms defined: scss, android, compose, ios, and ios-swift. Each platform has a transformGroup, buildPath, and files. The buildPath and files of the platform should match up to the files what were built. The files built should look like these:\n\n**Android**\n\n```xml\n\u003c!-- font_dimens.xml --\u003e\n\u003cresources\u003e\n  \u003cdimen name=\"size_font_small\"\u003e12.00sp\u003c/dimen\u003e\n  \u003cdimen name=\"size_font_medium\"\u003e16.00sp\u003c/dimen\u003e\n  \u003cdimen name=\"size_font_large\"\u003e32.00sp\u003c/dimen\u003e\n  \u003cdimen name=\"size_font_base\"\u003e16.00sp\u003c/dimen\u003e\n\u003c/resources\u003e\n\n\u003c!-- colors.xml --\u003e\n\u003cresources\u003e\n  \u003ccolor name=\"color_base_gray_light\"\u003e#ffcccccc\u003c/color\u003e\n  \u003ccolor name=\"color_base_gray_medium\"\u003e#ff999999\u003c/color\u003e\n  \u003ccolor name=\"color_base_gray_dark\"\u003e#ff111111\u003c/color\u003e\n  \u003ccolor name=\"color_base_red\"\u003e#ffff0000\u003c/color\u003e\n  \u003ccolor name=\"color_base_green\"\u003e#ff00ff00\u003c/color\u003e\n  \u003ccolor name=\"color_font_base\"\u003e#ffff0000\u003c/color\u003e\n  \u003ccolor name=\"color_font_secondary\"\u003e#ff00ff00\u003c/color\u003e\n  \u003ccolor name=\"color_font_tertiary\"\u003e#ffcccccc\u003c/color\u003e\n\u003c/resources\u003e\n```\n\n**Compose**\n\n```kotlin\nobject StyleDictionaryColor {\n  val colorBaseGrayDark = Color(0xff111111)\n  val colorBaseGrayLight = Color(0xffcccccc)\n  val colorBaseGrayMedium = Color(0xff999999)\n  val colorBaseGreen = Color(0xff00ff00)\n  val colorBaseRed = Color(0xffff0000)\n  val colorFontBase = Color(0xffff0000)\n  val colorFontSecondary = Color(0xff00ff00)\n  val colorFontTertiary = Color(0xffcccccc)\n}\n\nobject StyleDictionarySize {\n  /** the base size of the font */\n  val sizeFontBase = 16.00.sp\n  /** the large size of the font */\n  val sizeFontLarge = 32.00.sp\n  /** the medium size of the font */\n  val sizeFontMedium = 16.00.sp\n  /** the small size of the font */\n  val sizeFontSmall = 12.00.sp\n}\n```\n\n**SCSS**\n\n```scss\n// variables.scss\n$color-base-gray-light: #cccccc;\n$color-base-gray-medium: #999999;\n$color-base-gray-dark: #111111;\n$color-base-red: #ff0000;\n$color-base-green: #00ff00;\n$color-font-base: #ff0000;\n$color-font-secondary: #00ff00;\n$color-font-tertiary: #cccccc;\n$size-font-small: 0.75rem;\n$size-font-medium: 1rem;\n$size-font-large: 2rem;\n$size-font-base: 1rem;\n```\n\n**iOS**\n\n```objc\n#import \"StyleDictionaryColor.h\"\n\n@implementation StyleDictionaryColor\n\n+ (UIColor *)color:(StyleDictionaryColorName)colorEnum{\n  return [[self values] objectAtIndex:colorEnum];\n}\n\n+ (NSArray *)values {\n  static NSArray* colorArray;\n  static dispatch_once_t onceToken;\n\n  dispatch_once(\u0026onceToken, ^{\n    colorArray = @[\n[UIColor colorWithRed:0.800f green:0.800f blue:0.800f alpha:1.000f],\n[UIColor colorWithRed:0.600f green:0.600f blue:0.600f alpha:1.000f],\n[UIColor colorWithRed:0.067f green:0.067f blue:0.067f alpha:1.000f],\n[UIColor colorWithRed:1.000f green:0.000f blue:0.000f alpha:1.000f],\n[UIColor colorWithRed:0.000f green:1.000f blue:0.000f alpha:1.000f],\n[UIColor colorWithRed:1.000f green:0.000f blue:0.000f alpha:1.000f],\n[UIColor colorWithRed:0.000f green:1.000f blue:0.000f alpha:1.000f],\n[UIColor colorWithRed:0.800f green:0.800f blue:0.800f alpha:1.000f]\n    ];\n  });\n\n  return colorArray;\n}\n\n@end\n```\n\nPretty nifty! This shows a few things happening:\n\n1. The build system does a deep merge of all the token JSON files defined in the `source` attribute of `config.json`. This allows you to split up the token JSON files however you want. There are 2 JSON files with `color` as the top level key, but they get merged properly.\n1. The build system resolves references to other design tokens. `{size.font.medium.value}` gets resolved properly.\n1. The build system handles references to token values in other files as well as you can see in `tokens/color/font.json`.\n\nNow let's make a change and see how that affects things. Open up `tokens/color/base.json` and change `\"#111111\"` to `\"#000000\"`. After you make that change, save the file and re-run the build command `style-dictionary build`. Open up the build files and take a look.\n\n**Huzzah!**\n\nNow go forth and create! Take a look at all the built-in [transforms](https://amzn.github.io/style-dictionary/#/transforms?id=pre-defined-transforms) and [formats](https://amzn.github.io/style-dictionary/#/formats?id=pre-defined-formats).\n\n**How to use Alias tokens**\n\nYou can check our explainer video [here](https://weare.frontify.com/document/1269#/alias-tokens/how-to-use-alias-tokens) on Fondue Docs.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrontify%2Ffondue-tokens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrontify%2Ffondue-tokens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrontify%2Ffondue-tokens/lists"}