openpencil/tests/fixtures/pen-variables.pen
PAVEL TKACHEV c946337f3d
fix(pen): resolve ordinary variable references (#622)
* fix(pen): resolve ordinary variable references

Recognize nonempty dollar-prefixed variable names while preserving double-dash references and existing bindings.

Add parser regressions, a reproducible .pen fixture, and visual coverage comparing variable references with literal values.

Update the Unreleased changelog for #563.

* test(pen): strengthen variable reference coverage

---------

Co-authored-by: Danila Poyarkov <dev@dannote.net>
2026-09-06 23:50:03 +03:00

78 lines
1.7 KiB
Plaintext

{
"version": "2.14",
"variables": {
"merk-blauw": { "type": "color", "value": "#4094D0" },
"font-tekst": { "type": "string", "value": "Noto Naskh Arabic" },
"--merk-blauw": { "type": "color", "value": "#4094D0" },
"--font-tekst": { "type": "string", "value": "Noto Naskh Arabic" }
},
"children": [
{
"id": "literal",
"type": "frame",
"name": "Literal values",
"x": 60,
"y": 80,
"width": 220,
"height": 160,
"fill": "#4094D0",
"children": [
{
"id": "literal-text",
"type": "text",
"x": 24,
"y": 60,
"content": "مرحبا بالعالم",
"fontFamily": "Noto Naskh Arabic",
"fontSize": 22,
"fill": "#FFFFFF"
}
]
},
{
"id": "plain",
"type": "frame",
"name": "$name references",
"x": 320,
"y": 80,
"width": 220,
"height": 160,
"fill": "$merk-blauw",
"children": [
{
"id": "plain-text",
"type": "text",
"x": 24,
"y": 60,
"content": "مرحبا بالعالم",
"fontFamily": "$font-tekst",
"fontSize": 22,
"fill": "#FFFFFF"
}
]
},
{
"id": "dashed",
"type": "frame",
"name": "$--name references",
"x": 580,
"y": 80,
"width": 220,
"height": 160,
"fill": "$--merk-blauw",
"children": [
{
"id": "dashed-text",
"type": "text",
"x": 24,
"y": 60,
"content": "مرحبا بالعالم",
"fontFamily": "$--font-tekst",
"fontSize": 22,
"fill": "#FFFFFF"
}
]
}
]
}