Skip to content

Te CLI pantoken

@pantoken/cli e whakarato ana i pantoken generate <target>, e tuhi ana i te puna token ki roto i tētahi repo wāhi. Tukua kia whakamahia i ngā wā e hiahiatia ana he waehere i hangaia mō tētahi papa, kaua hei whakawhirinaki ki te wa-tūnga — taupānga taketake, ngā kaupapa CMS, me ngā pūhanga pae mārō.

sh
npx pantoken generate <target> --out <dir> [--theme <name>] [--icons a,b,c]

Ngā Whāinga

WhāingaPutanga
swiftPuna Swift i raro i Sources/<name> me tētahi tūtohu manifest SwiftPM Package.swift.
androidNgā kōnae rauemi XML mō Android.
composeHe kōnae Kotlin mō Jetpack Compose.
flutterHe kōnae Dart mō Flutter.
rustHe tokens.rs mō egui (taunoa) ranei iced (--format iced).
wordpressHe theme.json mō te block-theme.
vanillaHe variables.json mō Vanilla Forums.
drupalNgā rawa kaupapa Drupal.
jekyllRaraunga pae Jekyll.
hugoRaraunga pae Hugo.
swatchesNgā rārangi tae — ase (taunoa), gpl, sketch, ranei svg mā te whakamahi i --format.
icon-fontHe pūranga pūoro tukutuku tohu (TTF, WOFF2), tana CSS, me tētahi mapi tohu waehere.
pendoTe global.css āhua Instructure mō ngā aratohu Pendo.

Ngā Kōwhiringa noa

  • --out <dir> — kei hea te tuhi (taunoa ./pantoken-out).
  • --theme <name>rebrand (taunoa), canvas, ranei canvasHighContrast.
  • --icons a,b,c — ngā ingoa tohu hei whakaputa hei rawa taketake, mō ngā whāinga e tautoko ana i aua mea.
  • --class <Name> — te momo i hangaia, te ingoa mō te mōkihi rānei, mō ngā whāinga e hiahiatia ana.
  • --format <fmt> — te hōputu putanga, mō swatches me rust.

Tauira

sh
# iOS tokens plus two icons, in the Canvas theme.
npx pantoken generate swift --out ./ios/Tokens --theme canvas --icons arrow-left,check-mark

# A WordPress block theme's theme.json.
npx pantoken generate wordpress --out ./wp-content/themes/mytheme

# An egui palette for a Rust app.
npx pantoken generate rust --out ./src/tokens.rs --format egui

E tukuna ana e ētahi whāinga he tātai mahi mārama hoki, kia taea ai te kãcall i a rātou mai tōu ake hanga i te tūnga o te CLI. Tirohia te API reference mō ia mōkihi papa.