@@ -85,7 +85,6 @@ Additionally, the following Swift file will be created to use colors from the co
85
85
static var backgroundVideo: UIColor { return UIColor (named : #function )! }
86
86
...
87
87
}
88
-
89
88
```
90
89
91
90
For SwiftUI the following Swift file will be created to use colors from the code.
@@ -99,7 +98,6 @@ For SwiftUI the following Swift file will be created to use colors from the code
99
98
static var backgroundVideo: Color { return Color (#function ) }
100
99
...
101
100
}
102
-
103
101
```
104
102
105
103
If you set option ` useColorAssets: False ` in the configuration file, then will be generated code like this:
@@ -221,6 +219,7 @@ Example of these files:
221
219
222
220
Colors will be exported to ` values/colors.xml ` and ` values-night/colors.xml ` files.
223
221
For Jetpack Compose, following code will be generated, if configured:
222
+
224
223
``` kotlin
225
224
package com.redmadrobot.androidcomposeexample.ui.figmaexport
226
225
@@ -234,6 +233,7 @@ fun Colors.backgroundPrimary(): Color = colorResource(id = R.color.background_pr
234
233
```
235
234
236
235
Icons will be exported to ` drawable ` directory as vector xml files. For Jetpack Compose, following code will be generated, if configured:
236
+
237
237
``` kotlin
238
238
package com.redmadrobot.androidcomposeexample.ui.figmaexport
239
239
@@ -260,6 +260,7 @@ Vector images will be exported to `drawable` and `drawable-night` directories as
260
260
Raster images will be exported to ` drawable-???dpi ` and ` drawable-night-???dpi ` directories as ` png ` or ` webp ` files.
261
261
262
262
Typography will be exported to ` values/typography.xml ` . For Jetpack Compose, following code will be generated, if configured:
263
+
263
264
``` kotlin
264
265
package com.redmadrobot.androidcomposeexample.ui.figmaexport
265
266
@@ -290,16 +291,20 @@ object Typography {
290
291
[ Download] ( https://github.com/RedMadRobot/figma-export/releases ) the latest release and read [ Usage] ( #usage )
291
292
292
293
### Homebrew
293
- ```
294
+
295
+ ``` bash
294
296
brew install RedMadRobot/formulae/figma-export
295
297
```
298
+
296
299
If you want to export raster images in WebP format install [ cwebp] ( https://developers.google.com/speed/webp/docs/using ) command line utility.
297
- ```
300
+
301
+ ``` bash
298
302
brew install webp
299
303
```
300
304
301
305
### CocoaPods + Fastlane
302
306
Add the following line to your Podfile:
307
+
303
308
``` ruby
304
309
pod ' FigmaExport'
305
310
```
@@ -308,6 +313,7 @@ This will download the FigmaExport binaries and dependencies in `Pods/` during y
308
313
` pod install ` execution and will allow you to invoke it via ` Pods/FigmaExport/Release/figma-export ` in your Fastfile.
309
314
310
315
Add the following line to your Fastfile:
316
+
311
317
``` ruby
312
318
lane :sync_colors do
313
319
Dir .chdir(" ../" ) do
@@ -321,6 +327,7 @@ Don't forget to place figma-export.yaml file at the root of the project director
321
327
Run ` fastlane sync_colors ` to run FigmaExport.
322
328
323
329
## Usage
330
+
324
331
1 . Open ` Terminal.app `
325
332
2 . Go (cd) to the folder with ` figma-export ` binary file
326
333
3 . Run ` figma-export `
@@ -413,7 +420,8 @@ Example of `figma-export.yaml` file for iOS project — [Examples/Example/figma-
413
420
Example of ` figma-export.yaml ` file for Android project — [ Examples/AndroidExample/figma-export.yaml] ( ./Examples/AndroidExample/figma-export.yaml )
414
421
415
422
Generate ` figma-export.yaml ` config file using one of the following command:
416
- ```
423
+
424
+ ``` bash
417
425
figma-export init --platform android
418
426
figma-export init --platform ios
419
427
```
0 commit comments