From 40de64fffecbc61e0cd429b629602b9f8ebc667b Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sun, 9 Jul 2023 12:42:52 -0700 Subject: [PATCH] chore: add support for exporting our colors as Swift files --- .gitignore | 1 + web/style-definitions/config.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/.gitignore b/.gitignore index 75b920ea0..79a08ecd8 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ test/automated/browser/screenshots lefthook.yml test/automated/browser/cypress/screenshots test/automated/browser/cypress/videos +web/style-definitions/build/ web/public/sw.js web/public/workbox-*.js diff --git a/web/style-definitions/config.js b/web/style-definitions/config.js index 15930ae06..7ab0ddf20 100644 --- a/web/style-definitions/config.js +++ b/web/style-definitions/config.js @@ -54,5 +54,29 @@ module.exports = { }, ], }, + 'ios-swift': { + transforms: [ + 'attribute/cti', + 'name/ti/camel', + 'color/ColorSwiftUI', + 'content/swift/literal', + 'asset/swift/literal', + 'size/swift/remToCGFloat', + 'font/swift/literal', + ], + buildPath: 'build/', + files: [ + { + format: 'ios-swift/class.swift', + className: 'PlatformColor', + destination: 'Colors.swift', + filter: { + attributes: { + category: 'color', + }, + }, + }, + ], + }, }, };