formds_tokens 2.0.0 copy "formds_tokens: ^2.0.0" to clipboard
formds_tokens: ^2.0.0 copied to clipboard

Flutter tokens for the Form Design System (Lyse).

formds_tokens #

Audience: Consumer (Flutter app teams)
Owner: FormDS maintainers
Source of truth: This README (candidate for future Zeroheight migration)

formds_tokens provides generated FormDS token constants for Flutter, split by brand and light/dark mode. Pick a brand, import a mode, and you are ready to theme UI components quickly.

Features #

  • Brand and semantic colors as Color values
  • Spacing, radii, and sizing values as numeric constants
  • Separate light/dark token classes per brand
  • Raw JSON token assets in assets/json/

Installation #

Install from pub.dev:

dependencies:
  formds_tokens: ^0.1.0

For alpha/nightly channels, use a pre-release version:

  • x.y.z-alpha.n
  • x.y.z-nightly.timestamp

Usage #

Example: Altibox, light mode

import 'package:formds_tokens/altibox_light.dart';

final primary = AltiboxLight.brandColorInteractivePrimaryBase; // Color
final radius = AltiboxLight.brandBorderDefault; // double

Example: Konsern, dark mode

import 'package:formds_tokens/konsern_dark.dart';

final bg = KonsernDark.brandColorBackgroundBase;

Which Import Should I Pick? #

  • If your UI is light mode: import <brand>_light.dart
  • If your UI is dark mode: import <brand>_dark.dart
  • If your app supports both: switch imports/usages based on your theme mode

Brands and Themes #

Current brand entrypoints:

  • altibox_light.dart / altibox_dark.dart
  • form_light.dart / form_dark.dart
  • konsern_light.dart / konsern_dark.dart
  • lyse_light.dart / lyse_dark.dart

You can import the mode-specific file your app needs per runtime theme.

Token Layer Model #

The generated values come from the same token layer stack used across platforms:

  • primitive -> theme -> responsive -> brand

Higher layers can reference values from their own layer or lower layers.

Package Layout #

Public entrypoints:

  • lib/<brand>_<light|dark>.dart

Generated internals:

  • lib/src/<brand>/<light|dark>/tokens_style_dictionary.dart

JSON assets:

  • assets/json/**

Versioning and Channels #

Token releases are tagged in the repository and published to pub.dev:

  • tokens-v<version> (stable)
  • tokens-v<version>-alpha.<n>
  • tokens-v<version>-nightly.<timestamp>

Tag and package versions match (tokens-v2.0.0-alpha.1 publishes as 2.0.0-alpha.1).

Maintainers #

Token sync/release pipeline docs:

  • docs/tokens/local-development.md
  • docs/tokens/release.md

For issues or contributions, see the repository at formds-figma-exporter.

0
likes
120
points
364
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter tokens for the Form Design System (Lyse).

Repository (GitHub)

License

MIT (license)

Dependencies

flutter

More

Packages that depend on formds_tokens