A production-oriented, Docker-first developer tool for validating design tokens and compiling them into platform-specific artifacts.
Give the compiler a JSON or YAML token file and it will:
{token.path} aliases and detect alias cycles;docker pull YOUR_DOCKER_USERNAME/design-system-compiler:1.0.0
docker run --rm -p 8080:8080 YOUR_DOCKER_USERNAME/design-system-compiler:1.0.0
Open http://localhost:8080.
dsc audit examples/tokens.json --json
dsc compile examples/tokens.json --format css typescript react-native tailwind dart scss --output generated
docker run --rm \
-v "$PWD/examples:/input:ro" \
-v "$PWD/generated:/output" \
YOUR_DOCKER_USERNAME/design-system-compiler:1.0.0 \
compile /input/tokens.json --output /output
The compiler understands the W3C-style $value, $type and $description shape, while keeping a small compatibility path for {value, type, description} objects.
{
"color": {
"brand": {
"primary": {
"$value": "#2563EB",
"$type": "color",
"$description": "Primary brand color."
}
}
},
"spacing": {
"md": {
"$value": "16px",
"$type": "dimension"
}
},
"button": {
"padding": {
"$value": "{spacing.md}",
"$type": "dimension"
}
}
}
A design system becomes much easier to maintain when its source-of-truth tokens are validated once and compiled consistently for each target. This project keeps the source token format small and inspectable while making the build step deterministic.
For mobile products, the same token source can support reusable component libraries in a طراحی اپلیکیشن موبایل workflow. For more application-like browser products, the generated theme can become part of a طراحی وب اپلیکیشن system. For public-facing sites, CSS variables and responsive tokens provide a clean foundation for طراحی سایت without scattering hard-coded values across pages.
| Target | File | Main use |
|---|---|---|
| CSS | tokens.css | Web CSS custom properties |
| SCSS | _tokens.scss | Sass codebases |
| TypeScript | tokens.ts | Web/Node application code |
| React Native | tokens.native.ts | React Native/Expo |
| Tailwind | tailwind.config.js | Tailwind theme extension |
| Dart | design_tokens.dart | Flutter/Dart |
| JSON | tokens.resolved.json | Tooling and pipelines |
POST /compile
Content-Type: application/json
Request:
{
"tokens": {
"color": {
"primary": {"$value": "#2563EB", "$type": "color"}
}
},
"targets": ["css", "typescript"]
}
GET /health can be used by containers and orchestrators for readiness checks.
src/design_system_compiler/
├── core.py # Token model, validation, aliases and compilers
├── io.py # JSON/YAML input and output files
├── audit.py # Machine-readable audit reports
├── cli.py # CLI entrypoint
└── server.py # HTTP API + browser UI
python -m unittest discover -s tests -v
python -m pip install -e .
dsc version
dsc audit examples/tokens.json --json
dsc compile examples/tokens.json --output generated
Build and tag the image:
docker build -t YOUR_DOCKER_USERNAME/design-system-compiler:1.0.0 .
docker tag YOUR_DOCKER_USERNAME/design-system-compiler:1.0.0 YOUR_DOCKER_USERNAME/design-system-compiler:latest
Authenticate and push:
docker login
docker push YOUR_DOCKER_USERNAME/design-system-compiler:1.0.0
docker push YOUR_DOCKER_USERNAME/design-system-compiler:latest
Docker Hub repositories use tags to distinguish image versions, and the repository Overview is where users should find usage instructions, features, documentation links and license information. See the official Docker Hub documentation before publishing.
This release focuses on deterministic token compilation. It is not a visual design editor and it does not attempt to infer layout rules from screenshots. Future releases can add token transformations, theme generation, contrast matrices and repository integrations without changing the source token contract.
MIT. See LICENSE.
Content type
Image
Digest
sha256:122bec80b…
Size
45.7 MB
Last updated
about 1 month ago
docker pull oudhami/design-system-compiler-v1.0