https://github.com/smartive/flutter-design-system-generator
Generator for Flutter projects to use design system tokens in dart code.
https://github.com/smartive/flutter-design-system-generator
Last synced: about 1 year ago
JSON representation
Generator for Flutter projects to use design system tokens in dart code.
- Host: GitHub
- URL: https://github.com/smartive/flutter-design-system-generator
- Owner: smartive
- License: apache-2.0
- Created: 2023-03-15T15:21:23.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-24T14:05:54.000Z (over 1 year ago)
- Last Synced: 2025-02-24T15:24:56.258Z (over 1 year ago)
- Language: Dart
- Homepage: https://pub.dev/packages/design_system_generator
- Size: 102 KB
- Stars: 1
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Design System Generator
This generator allows you to generate a design system for your project.
You can use it to generate design tokens based on a JSON configuration.
The configuration can be viewed at [Design System JSON Schema](./design-system.schema.json).
The generator creates the following elements:
- Colors
- Border Widths and helper functions to create borders
- Border Radii
- Spatials (spacing)
- Screensizes (Breakpoints) and a responsive helper function
- Text Styles (Typography)
- Icon Sizes
## Usage
Refer to the [example](./example/example.md) to see how to use the generator.
Summary:
- Create a `.design-system.json` file somewhere in your lib folder.
The generators will run for each file with the `.design-system.json` extension.
So you can have multiple design systems in your project.
- Configure your design system to your wishes
(add `"$schema": "https://github.com/smartive/flutter-design-system-generator/blob/main/design-system.schema.json"`)
to the start to get JSON schema validation
- Install the build runner with `flutter pub add dev:build_runner`
- Install the design system generator with `flutter pub add dev:design_system_generator`
- Run `dart run build_runner build --delete-conflicting-outputs` to generate the design system