Metadata-Version: 2.5
Name: wandelbots-design-tokens
Version: 3.2.0
Summary: Wandelbots NOVA design tokens for Python.
Project-URL: Homepage, https://wandelbotsgmbh.github.io/nova-design-system/#tokens
Project-URL: Repository, https://github.com/wandelbotsgmbh/nova-design-system
Author: Wandelbots GmbH
Keywords: design-system,design-tokens,nova,wandelbots
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# wandelbots-design-tokens

Wandelbots Nova design tokens as a frozen dataclass. No dependencies.

Generated from the same Figma source as the [`@wandelbots/design-tokens`](https://www.npmjs.com/package/@wandelbots/design-tokens)
npm package — both are released in lockstep and always carry the same version.

## Install

```bash
pip install wandelbots-design-tokens
```

## Usage

```python
from wandelbots_design_tokens import DARK, THEMES

DARK.zero_gravity_text_primary   # '#ffffff'
DARK.radius_md                   # '20px'
```

`DARK` is the default theme. Every entry in `THEMES` is a **complete** `Tokens`
instance with the same fields, so a theme can be selected at runtime without
merging anything:

```python
tokens = THEMES["simulation"] if simulating else DARK
tokens.zero_gravity_background_default
```

Instances are frozen — assigning to a field raises `FrozenInstanceError`.

### Token paths

For dynamic lookup, `as_mapping()` returns a read-only mapping keyed by dotted
DTCG token path. `TOKENS` is that mapping for `DARK`.

```python
from wandelbots_design_tokens import TOKENS, THEMES, as_mapping

TOKENS["zero-gravity.text.primary"]
as_mapping(THEMES["simulation"])["radius.md"]
```

A key maps directly onto the CSS custom property: `--wb-` plus the key with
`.` replaced by `-`.

### Values

Values are strings exactly as emitted for CSS and JS — colors are hex,
dimensions carry their `px` suffix. Use `px()` when you need a number:

```python
from wandelbots_design_tokens import px

px(DARK.radius_md)   # 20.0
```

## Contributing

Token values come from Figma and the generated modules must never be
hand-edited — see the [repository README](https://github.com/wandelbotsgmbh/nova-design-system).

Run the tests with [uv](https://docs.astral.sh/uv/):

```bash
uv run --directory packages/design-tokens/python pytest
```
